To complete the blood magic ritual to awaken the dragons from the stone eggs.
She thought it was the horse that was used in Mirri's ritual. Mirri then laughs at her naiveté.
Let's remember that all of this happens when Dany is literally 14 years old.
Oh come on, blaming her for the fate of the Lhazareen is completely unfair here and you know this.
It's true that she's not in the right, and Mirri points that out to her quite strongly, but to frame this as Dany deliberately being responsible for the Lhazarren massacre and maliciously enslaving the survivors, rather than her being a naive teenage girl vainly attempting to try to make some good out of a horrible situation, is not an honest assessment of the character. Even if Dany is a bit older in the show, this was clearly shown as her being naive, not complicit. And that's how she learns an incredibly harsh life lesson out of it, too, and pays a hefty price. In the books (forgot if the show has this line) Dany even thanks Mirri for the "lesson", heh.