Let's see what was Kakashi trying to do. First of all, he summoned the wall behind Pain. So his intention was not to make a barrier to protect himself, but rather to limit Pain's movement, probably to make it harder for him to evade Kakashi's attacks. Right after that he tries to hit Pain with Raikiri, but because of Rinnegan he misses and hits the wall instead. Note that Pain is already pushed to the wall, so he can not evade backwards.
So basically he has just two ways to move to left: forward, from where Kakashi is attacking, or upward, trying to jump over the wall. Considering this, I would assume that the dog heads are there to prevent the enemy from doing so, and possible catch and hold him at the wall if he is reckless enough.
Note that it is not the only technique which combines Earth element and Kakashi's dogs. He also uses Kuchiyose: Doton: Tsuiga no Jutsu (literally "Summoning: Earth Release: Tracking Fang") in his battle against Zabuza. In this technique, tha dogs travel underground, track their target and then assault it with their fangs to hold it still and let Kakashi hit it with Raikiri.
So yes, I think the wall had roughly the same purpose.