I wonder why did that.
I ask, "Why did he do that?". <--- direct quotation (of yourself)
I ask why did that. <---- reported or indirect quotation (of yourself).
To wonder is not yet to ask. So there's no speech to report directly. It seems a little silly, therefore, to say
I wonder, "Why did he do that?".