The reason your legs hurt after walking could be just due to the fact that your muscles and tendons are stressed from walking.
This happens to me sometimes as well and the pain goes away shortly after I stop walking.
When you're walking or doing any other exercise the pain while walking is usually your bodies way of saying you've had enough exercise or walking and need to rest now.
But if the pain continues or gets worse then it's not normal and could be caused by something else that needs a doctor to check out.
But if the pain goes away and your legs only hurt for a few hours after walking then it's normal.