Keeping the bike vertically does not cause any type of problem but it is right to be aware of an aspect related to the brakes or, better said, to the air in the brake system. If we apply the brake with the bike vertically, when it is released it will facilitate the passage of air. In short, you create depression, and therefore, when the piston returns, it will certainly draw in air.
Insights
MTB BRAKES: Can I keep the bike upright in the garage?
Can placing the bike vertically cause various types of problems? For example bringing air bubbles into the brake system?