Hi Harry! In this sentence, the verb 撞 is a little special.
When we want to say the phrase "hit on the wall" without any tense, we will say 撞在墙上. We put 在墙上 after the verb 撞, because the "hit" is a movement of sth. and the wall is the destination of this movement. This is not like 我在教室学习。I study in the classroom.
So hit on the wall is 撞在墙上. If it has happened, we add 了 after 在. When the phrase 在... is after the verb, we will do like this.
A similar example is: I ran to school. 我跑到了学校。