Kinetic energy (KE) = 0.5mv^2
For two cars of equal mass moving towards each other,
KE = 2*0.5*m*30^2 = 900m J
For one car hitting a wall, KE= 0.5m*30^2 = 450m J (since the wall is stationary).
It can be seen that two cars hitting each other head-on, the energy to be dissipated is twice as that to be dissipated for a car hitting a wall. This resuts to more damage as such energy is taken up by the contents in the car.