Male bettas will often mistake their reflections in the aquarium glass for a rival male and will attempt to defend their territory. This is really common when moving them into a new tank and in most cases they will stop after a couple of days as they get used to their new surroundings. If your betta flares constantly and doesn't stop after a few days, then there are somethings you can do to reduce yhe behavior .
Often the easiest fix is to adjust the light. The reflection is caused by the angle at which the light is hitting the glass. Often turning the tank or moving it to another location will fix the problem. Also, the background color outside the aquarium can enhance or reduce his ability to see his reflection. Darker colors show the reflection more than light colors. Keeping the tank away from walls or nearer light colored walls will be better then keeping it against a dark wall. Also, attaching a background to the back of the aquarium glass will often camouflage reflections as well. While a solid blue or black backdrop will often worsen the reflections, images of aquarium plants or rocks will help hide the reflection.