I asked one person 'Why you did that' referring to something he did in the past, and he responded something like 'Why are you saying that, are you a little kid?'. I was confused and asked him why would he say that, he responded that I need to use 'Why did you do that' instead.
Why 'Why you did that' was incorrect and why he was referring to a little kid thing?