Last week, Community aired it's second Dungeons & Dragons episode. It was as hilarious as it was accurate, especially Abed's explanations of his role as DM. In his own words "I am a Dungeon Master. I create a boundless world and I bind it by rules. Too heavy for a bridge? It breaks. Get hit? Take damage..." It goes on a bit, but I risk spoilers for those who haven't seen it.
It's a spot on description of what a DM should do and be. A DM has to be impartial. I've said before, coddling a party is no way to play. What kind of adventure doesn't carry any risk with it? A DM deals in consequence. Sometimes we end up disappointed. In our preparation, it's not uncommon to get really attached to a particular encounter, puzzle or secret. Instead of doing everything to steer a party towards it, a good DM should let them move right on past it, even as you feel your heart breaking.
A DM should never strive to; meet expectation, ensure survival, or answer prayers. Every adventure is dangerous, and your party will not always survive. In those situations, it's more important than ever to remain as impartial as possible. Vagaries in the rules and modules can be fudged one way or another as you see fit, but it's vital to play true to the situation. A party can easily pick up on your attempts to dial things down for them in a tight spot or after a major defeat. In almost every case, a DM will say they are doing it for the party, and in almost every case it's a lie. It's a selfish act, and it has no place in a serious game.
A challenged party changes. They evolve and learn from previous encounters and mistakes. If they're thick headed, it may take a few dead characters before they get the idea, but they'll never improve if you keep adjusting the difficulty to keep them alive.
It's less about balance in this case. Spells, party makeup, loot division and many other game mechanics depend on proper balance, but the DM has a very clear, well defined role and place in the game. If the party misses your cleverly disguised Doctor Who Easter egg, you can weep about it later. You are there to outline their experience, not tailor it to your ego.
Your party will not always like you. There will come a moment, a roll, a rules call, something they don't feel was right or fair. They will argue, they will try to bend the rules to fit their schemes. They'll get over it, and as long as you followed the rules to the best of your ability, you are not at fault for their reaction. The role of DM is not meant for those who want to make friends. The DM's role is for story tellers. They don't have to like the story you tell, you need only tell it honestly.