One reason is that it avoids a certain line that you would get after playing 7...Qb6, which is 8.Nb3
If Black plays 7...h6 first, 8.Bh4 Qb6 9.Nb3 is no longer possible because Black can play 9...Qe3+ winning the f4-pawn. This would not have been the case in the 7...Qb6 line since the bishop would have still been on g5, protecting the pawn.
Another reason is that sometimes Black would like to play ...g5.
[FEN ""]
1.e4 c5 2.Nf3 d6 3.d4 cxd4 4.Nxd4 Nf6 5.Nc3 a6 6. Bg5 e6 7. f4 Qb6 (7...h6 8. Bh4 Qb6 9. Nb3 Qe3+ 10.Qe2 (10.Be2 Nxe4) 10...Qxf4) 8. Nb3 Be7 (8...Qe3+ 9.Qe2)