"Whatcha" which is not proper English, is a "lazy" contraction of "What did you" or "What are you". So your phrase means "What did you do that for?". Another common use is "Whatcha up to?" meaning "What are you up to?". That means " What are you doing now?".
Whatcha should only be used in verbal communication between close friends and family. At work, after becoming close with a co-worker, it might also be used, but never with a boss or in a formal setting.