It probably didn't
Here's what the shield looks like in the first scene you mention:
Those don't really look like dents to me. They look darker than the shield, not merely shadowed. I suspect they are residue from the tracks of the bullets themselves, rather than dents on the shield.
Here's another scene from slightly later on:
It's more clear that these are simply scuff marks, rather than dents. Note that the paint is not invulnerable.
Here's an image from a promotional poster for The Winter Soldier:
Note that there are plenty of residue marks here, which seems to make it unlikely that Captain America's shield was pristine during The Winter Soldier.
A better question might be why there are a few rather obvious scratches on the shield.