There could be a few reasons for this. It sounds contradictory, but under or over mixing your muffin batter can cause them to flatten. You want to whip in enough air that they are fluffy and the gluten is mixed, but not over whip them so that they get too much air in and they sink when they bake, losing air. Also, tossing your blueberries in flour before adding them to the batter will help them not to sink to the bottom of the pan, can pull air out. Lastly, letting your batter sit for 20-30 minutes before putting it in the oven will help the baking powder fluff up the batter more.