Bayern beat third division Unterhacing 2-1 on Wednesday, with senior squad members Ribery, Diego Contento and Brazilian defender Breno all taking part as they continue their recoveries from injury.
Van Gaal, though, expressed particular disappointment with the performance of French international Ribery, who has been out for eight weeks with an injury to his right ankle.
"He didn't make any effort and showed no commitment," said van Gaal, who is likely to name Ribery on the bench for Saturday's game with Bayer Leverkusen.
"It's a shame. I don't organise friendly matches for my own good. None of them really did anything, but the prize goes to Ribery."
Van Gaal, who also clashed with Ribery last season over the Frenchman's readiness to return from injury, said the 27-year-old was not in the right physical shape to make a successful comeback.
"His preparations haven't been good," added the Dutchman.
Ribery made his return from injury with a 20-minute substitute appearance in Bayern's 3-0 win at home to Nuremberg last Sunday.
In an interview with Munich daily tz, Ribery admitted that his relationship with van Gaal was sometimes challenging.
"He has a very strong personality and it's something that I respect," said Ribery. "I listen to him and I know I can get better."
Ribery also said that Bayern could still retain their German title, despite currently being 12 points behind leaders Borussia Dortmund, and his coach was in agreement.
"It's very good that he says that everything is still possible," said van Gaal.
Ribery has had a tough year, having been charged with soliciting an under-age prostitute and banned for three games by the French Football Federation over his role in France's World Cup training boycott.