I agree with Perseus. The move is very much a "I double-dog dare you to castle queenside" move. It is probably not best here - and would be definitely bad if black could castle short.
Beyond that, however, we can't generalize. In the Ruy Lopez, white plays a4 to create weak pawns to attack. In some sicilian variations, he plays a4 to restrain black's queenside advance, or to secure the b5 square for a N.