I did not understand this bit of Game of Thrones S02E10. I thought Doreah chose to be with Xaro Xhoan Daxos to save Daenerys life?
But Daenerys somehow felt betrayed and sentenced her to death inside the giant vault along with Xaro Xhoan. Why?
Let's see the situation from Daenerys's eyes:
In short, the whole ordeal has made Dany a less trusting person (the lesson she thanks Xaro for), and now sees Doreah as a traitor who deserves death.
Did Doreah really do what she did to save Dany's life? Perhaps. But the price (the death of Irri and the kidnapping of the dragons) was too high to justify it in Dany's eyes.
Also, in a deleted scene it is revealed that Doreah herself killed Irri with a strangling cord when Irri walked in to find the dragons in cages, so it is truly a life for a life.
Well, let's see...
Dany sees Doreah as a common whore and not her friend at all in the end, so she locked her (and Xaro) up in that vault for good reason.
Think about it, if you were in Daenerys's place.
Doreah betrays Dany by teaming up with Xaro, who in turn is teamed up with the Undead Warlock to steal the dragons. This is made clear by the bed scene - Xaro had asked Dany to marry him, then sleeps with her handmaiden (not very sincere, is he?) Also the masked mysterious woman from Xaro's party later tells Ser Jorah, when he seeks her out whilst looking for the dragons, that "the thief is with her now" (meaning with Dany), and in the scene prior she was last with Xaro.
As for the dragons, it is consistently emphasised all through S2 that whoever has dragons will have the ultimate power in the world of GOT. And that men will "lust" for that power. Xaro is the wealthiest man in Qarth; by elimination of all other motives, it's reasonable if not obvious to conclude Xaro bought Doreah off to assist with stealing the dragons because Dany wouldn't hurry up and say yes to marrying him.
And remember Doreah had no love for Irri - they are fighting in one of the scenes leading up to D's return to Xaro's villa where she finds her people dead and the dragons gone. Also, remember that Doreah was originally bought as a slave by Dany's brother for her in the first season. So they never started out as friends and yes even though Dany gave her her freedom later on, she obviously got greedy for Xaro's wealth and has either offered to help or had been seduced to help (although remember she was always a prostitute - she says so in season one, from the age of 12). She was always going to side with the highest bidder or whoever could offer her the most.