both of these sentences sound correct to me: 1) He wants to know what she said; 2) He wants to know what did she say. Why the second one is wrong?
It's the difference between reported speech and direct speech. The second one is not strictly wrong, but in writing you will need to punctuate it differently to make it right.
A simple comma can be sufficient for that:
He wants to know, what did she say.
or you might set it off as an actual quote
He wants to know: "What did she say?"
Both of these are fine. In both cases you are actually asking a question. And so the do-support and the inversion are not only correct, but indeed required.
On the other hand, "He wants to know what she said" is simply reporting on a fact. "He wants to know X". That X happens to be what she said. You are not asking a question.
Lastly, the inversion can also be used for emphasis. Observe:
According to May, Putin said he wanted to invade Ireland. According to Merkel, he never said any such nonsense. According to Trump, he wanted to invade Cuba instead. We are left wondering, what exactly did Putin say and when.
You could just as well use the normal order "we are left wondering what exactly Putin said" but that takes all the emphasis out of it.
The first sentence
He wants to know what she said
is correct. If you want to keep the same word order in the second sentence
He wants to know what did she say
you could write this
He asks "what did she say?"
Also nit-picking your own question
Why the second one is wrong?
Why is the second one wrong?
which is also about word order.