I think there are three parts to this:
1. Why does he care about Jon and side with his friends at all?
See Purpose of Davos protecting Jon Snow?. Basically, he's been thrust into siding with Jon's friends by circumstances, and doesn't have a whole lot else to live for at this moment.
2. Why does he seem emotionally invested in what happens to Jon?
The poignant looks at Jon's wounds and blood stains, and the passion and urgency in his voice, among other things, are signs there's more to Davos's actions than simply Jon's strategic importance for the faction Davos has ended up joining.
There are three factors that give Jon's fate personal resonance to Davos:
- Davos is a good man who gets passionate and emotionally invested when good, innocent people are wronged. Remember the risks he took and the urgency and passion he showed when saving Gendry? He barely knew Gendry, too.
He personally relates to what happened to Jon. Jon was a good man who steadfastly did the right thing regardless of all other considerations, and was killed for it by an authoritarian bully, about whom Davos says:
I've been running from men like that all my life
What happened to Jon could have happened to Davos any of the times he did what was right knowing it'd be unpopular with someone powerful.
He didn't know Jon for long, but there was a bit of a mentor-like relationship building. Don't forget that Jon is a similar age to what Davos's late son would be. Davos clearly had a high opinion of Jon and took the time to mentor him a little, and was with Stannis when he specifically warned him about Alliser. From the transcript for episode 3 of series 5:
Stannis: You have many enemies in Castle Black. Have you considered sending Alliser Thorne elsewhere? Give him command of Eastwach-by-the-Sea.
Jon: I heard it was best to keep your enemies close.
Stannis: Whoever said that didn't have many enemies.
[pause]
Davos: He [Stannis] sees something in you. Might not be apparent from his tone, but it's the truth. He believes in you.
Jon's fate was rather personal for Davos.
3. Why is he keen for Melisandre to use magic to save him?
He mistrusts Melisandre and has passionately spoken out against her magic before.
Look back to when Davos most passionately spoke out against Melisandre's tricks, in episode 10 of series 3:
Davos: I don't know if Robb Stark died because of the Red Woman's sorcery or because at war men die all the time, but I do know that uniting the Seven Kingdoms with blood magic is wrong. It is evil. And you are not an evil man.
...and then continue the same conversation:
Stannis: Do you know who had this table carved and painted, Ser Davos?
Davos: Aegon Targaryen.
Stannis: And do you know how Aegon Targaryen conquered Westeros?
On the back of his dragon Balerion the Dread.
He had a smaller fleet than the kings he faced and a smaller army, but he had three dragons. Dragons are magic, Ser Davos. My enemies have made my kingdom bleed. I will not forget that. I will not forgive that. I will punish them with any arms at my disposal.
Davos: You do not need to burn the boy. If what you say is true, a drop of his blood killed Robb Stark...
Stannis argues that good ends can justify sinister, magical means. Davos doesn't argue with that - the thing he won't compromise on, however, is the killing of innocents.
Later on, he gives the impression that he's come to accept "blood magic" as an uncomfortable but sometimes necessary strategic compromise (from season 4, episode 3 transcript):
Davos: We're willing to use blood magic to put you on the throne, but we're not willing to pay men to fight? Now the Red Woman's magic is real. Her visions and prophecies may be, too, but I've never heard of visions and prophecies winning a war. Soldiers win wars. Soldiers on the ground.
His enthusiasm in this scene for something he had been so against is surprising, and maybe it could have been made clearer to the viewer, but it fits a pattern in which he slowly came to accept "blood magic" as being sometimes a necessary, acceptable evil for good aims, so long as innocents aren't killed.
You could see the incongruence as a sign of his desperation for some new worthwhile cause to wholeheartedly throw himself behind, like he had done with Stannis.
(and of course, he doesn't know about Shireen...)