It is possible there is no reason your betta is swimming at the water's surface, other than that's where he likes to be. In the wild bettas often live in shallow water, so this just may be where he feels most comfortable.
Bettas are anabantids, which means they can take gulps of air at the water's surface in addition to taking oxygen from the water through their gills. They have evolved this ability to survive poor water conditions in the wild.
Doing this occasionally is no big deal, but if you see your betta constantly going to the surface for air, your first concern should be poor water conditions in the tank. Test your water and see where your parameters stand. Even though bettas can survive in polluted, low-oxygen conditions in the short-term, in the long-term it leads to illness and death.
The solution is to keep your betta in a tank that is five gallons or larger, avoid overfeeding, and keep up with water changes and tank cleanings.
If your tank water is in good shape, watch for your betta blowing bubbles at the surface. Male bettas build "bubble nests" when conditions are right, and sometimes just blow random bubbles. It's normal behavior and nothing to worry about.