score:6
As Jon Custer writes, there are now Metrocard vending machines in the terminals. However, there are additional options for getting on a bus from LGA:
Upvote:7
From the La Guardia site one finds
MetroCards can be purchased at MetroCard vending machines located throughout LaGuardia Airport terminals. Passengers using MetroCards get a free transfer from their bus to the subway.
Going to their maps you can click and get an interactive map with search capability. Zoom in on Terminal B, and in the upper left search menu start typing 'Metro' which will autosuggest 'MetroCard Kiosk'. Hit enter and it will show:
One presumes the other terminals have ones as well, just use their search engine.