Three sentences all are correct and sound smooth. But each sentence has slightly different meaning with the others.
1. 왜 그렇게 말했어?: Why did you say in that way?
2. 왜 그런 말 했어?: Why did you say that?
3. 왜 말을 그렇게 해? Why do you say in that way? (This sentence sounds very aggressive, comparing with '왜 그렇게 말했어?'. It implies the speaker is very angry because of the way the opposite party uses when he/she says)
In addition, three formal forms you suggest are also correct in korean grammar. But in my oppinion, many korean might think those are too straight and feel unpleasant, if someone says the words to them. even though three formal forms have no problem, i recommend you to use other expressions instead when you communicate with native korean:-)