He's probably glass surfing. My betta Cameron does it. I upgraded his tank and that seems to have calmed it down a bit. Also you could put some plants in the area where he does it and that seems to do the job too.
I know for a fact Cameron does it because he gets bored too easily. I put colorful objects on the outside of the tank or over his head on the glass top of his tank. Things like that seem to keep bettas occupied for hours!
Winston~ Damian~ Twitch ~ Evans