Actions to take: Recognize that every decision is a trade-off, even those that you "have to" do. Don't always side with the higher-ups. Don't always side with your team. Use your judgement, and do what you believe will be most effective in the long run.
Every decision you make as a manger has trade-offs. Allow multiple people to take vacation before a holiday: you'll make them happy, but you'll put extra stress on the ones who are left behind. Implement a new service model: you'll be doing what the company expects, but your team is going to grumble about all the new work they have to do. Strictly enforce the dress code: you'll ensure that your team has a sharp appearance, but you may gain a reputation for being a stick in the mud.
Often, the trade-off boils down to a choice between doing what your company has instructed and doing what will make your team happy. Recognize the fact that, either way, you are getting in some kind of trouble. Accept that fact, and you will free yourself from the feeling that you are "supposed to" be one kind of boss or the other.
Don't always side with the higher-ups. As a manager, a big part of your job is to interpret communication from above and implement changes effectively for your team. "Interpret" does not mean "parrot back what I was told." If it were as simple as just saying to your team exactly what was said to you, there would be no need for your job. "Interpret and implement effectively" means figuring out how to achieve the outcome the higher-ups want you to achieve. Sometimes that means you need to encourage your boss to change some part of the plan. Sometimes it means fighting for a few weeks' extra time to implement effectively. And yes, occasionally it means doing things a little differently from what your boss told you because you know the rest will go 100% smoother that way.
By the same token, don't fight with higher ups about every little inconvenience for your team, and never simply ignore instructions from above. As a manager, you speak for the company. You represent the company to your employees, literally and legally. That is your job. When you defy company orders or deride the decision-making abilities of the people above you, you are failing to do part of your job. There are probably very good reasons why the company made these decisions, even for the ones you don't like. "It will make things worse for my team" is not a get-out-of-jail-free card. Your boss may be perfectly aware of that. They may have factored that into the decision and determined that it is worth the benefit that is being achieved somewhere else. As mentioned above, your job is to implement changes effectively, not to be judge and jury on what works and what doesn't.
In both cases, you need to recognize that you are putting yourself on the line. The former is scarier--getting in trouble with your boss has immediate job security implications. The latter path isn't a walk in the park either. If you always do exactly as you're told, your team will see you as a stooge. You'll lose credibility and effectiveness, which can lead to long-term job security implications. There is no safe path as a manager.
So how often do you do one, and how often do you do the other? The best strategy is to sidestep this thinking altogether. Do not be "the boss who always backs their team" or "the boss who always follows company directives." Do not try to game out how you want to be perceived at all. Instead, assess every situation independently and use your judgement. Your reputation will naturally become "the boss who thoughtfully reacts to each issue."