どうしてそんなこと

why would you do such a thing

→ どうして
phrase Rare #20,242
why would you do such a thing An emphatic way to question someone's action or words, often expressing surprise, disbelief, criticism, or hurt. The exact English translation depends on the verb that follows or is omitted.
JA: どうしてそんなこと言うの?
EN: Why would you say such a thing?

どうしてそんなことしたんだ

Why did you do that?

— 甘い生活 (1960)

お前さぁどうしてそんなことしたの

Hey, why did you do something like that?

お答えする前にどうしてそんなことお尋ねになるのか知りたいんですが

Before I answer, I'd like to know why you're asking that.

彼女はどうしてそんなことが可能なのか尋ねている

She is asking how such a thing is possible.

どうしてそんなこと謝らなければいけないの

Why do you have to apologize for something like that?

どうしてそんなこと分かるんだ

How could you possibly know that?

— ジョジョ・ラビット (2019)

どうしてそんなことになったんだと思う

Why do you think it ended up that way?