Why get the baker's hopes up?

When explaining the butler and baker's dreams, Yosef opened with very similar language:

בְּע֣וֹד ׀ שְׁלֹ֣שֶׁת יָמִ֗ים יִשָּׂ֤א פַרְעֹה֙ אֶת־רֹאשֶׁ֔ךָ

בְּע֣וֹד ׀ שְׁלֹ֣שֶׁת יָמִ֗ים יִשָּׂ֨א פַרְעֹ֤ה אֶת־רֹֽאשְׁךָ֙ מֵֽעָלֶ֔יךָ

As Yosef was saying it, the baker probably thought Yosef was going to say the same thing has he said to the butler, only to have his hopes shattered when Yosef said מעליך.

Why not break the news gently?

Was the parallel language necessary for an accurate interpretation of the dreams? (I suspect that's the answer, but I don't see where it's implied in the dreams.)

Rav Hirsch explains that Yosef interpreted the dreams from within the occurances of the dream. Thus as he explains in the dream of the butler

If one thinks that through dreams or othe symbolic signs that the One who sends the dream to the mind of a person wishes therebye to tell him something, the kind of symbol in the dream must be of such a natuer that the receiver of it can explain it to himself; it must be clear and apparent. He who hears the explanation must, if it is the correct one, be able to say to himself:"I really ought to have thought that out myself".

Indeed, Rav Hirsch on 40:16 also says that the worth of the explanation is seen in the truth of the words. and that

All that Josph added was that the three tendils which the vine had then to mature to blossoms and grapes were three days which still had to pass.

As Rav Hirsch says on Vayeishev 40:17](http://www.chabad.org/library/bible_cdo/aid/8235#v=17&showrashi=true)

And in the topmost basket were all kinds of Pharaoh's food, the work of a baker, and the birds were eating them from the basket atop my head."

All the food was worthy for Pharaoh and yet it was not he but the birds who ate it, and indeed they had the impudence to eat it away from me from the basket on my head. No birds would do that to a living person. It would be too afraid.

There was no way that he could break it gently to him. All he could do was tell him what the meaning of the dream was so that he could spend the next three days preparing for his death. Indeed, once he had explained it, it became obvious to him what would happen and any attempt to soften the explanation would be regarded as an insult.

As you suspected, the language had to be similar in order to show the accuracy of the two dreams. This is in order to say that these to dreams are closely related in that both will be יִשָּׂ֤א פַרְעֹה֙ אֶת־רֹאשֶׁ֔ךָ after three days with the difference in final results as shown by the ending of the dreams. Note the trop (cantillation marks) on the two phrases to show how they are related.

I haven't seen this directly addressed, but here's my own theory based on the explanation of the Chidah, who explains that from the the baker's saying "from on my head" (which was unnecessary, as he had already mentioned where the baskets were), Yosef understood that subconsciously the baker realized (his mazal saw) that he was going to die and was expressing it with this extra phrase. Maybe Yosef, in confirming this subliminal understanding, chose to employ the same wording of מעליך, and it wasn't really getting the baker's hopes up, as on some level the baker already knew the truth.

As is clear in the posuk, the baker only approached Yosef for an interpretation of his dream upon seeing the butler coming out with good news.

Seeing this it is safe to differentiate between the baker and the butler in that the butler was seeking the true message of his dream whereas the baker was going for the good news only, which means he was masquerading, pretending to be an innocent person seeking for the message relayed to him when in truth he was not which made him a liar.

It is important to note that when the Torah tells of someone lying or any other trait be it good or bad, it is a deeply rooted attribute of that person.For the Torah is very relevant and concise and in a posuk or two the Torah brings out the essence of the person spoken about. This is as we see that the Torah highlights Avraham's attribute of Chesed in a mere few pesukim and in Chazal's eyes it is this facet and virtue which stood as his merit forever.

The Midrash Bereishit Rabba (19:2) points out four that began their remark with the word 'Aff' meaning anger and were lost with that word, one of them being our baker. Now see the pirush Maharza'v on the Midrash who explains that these four were up to cruelty which brought this terminology to their tongue's. This illustrates to us how Chazal took every word that any character uttered and used that to explain their entire predicament.

Well, the posuk in Shmuel b' 22' says "with a crook act crooked".Yosef, replying to the baker's dishonest request in searching for the dream's true meaning, answered him accordingly, by appearing as though ready to glorify his quest for the good news.

Another understanding; the butler dreamt that he was serving the king again which meant that this was good news for him whereas the baker would not even dream of baking for the king again, as we do not see him dreaming that he carried the food to the king, showing us all that good news for him was anything but serving the king again