They are doing it because everybody is buying it in such large quantities that a small handful of people get all the ammo and everyone else is left griping about how there is no ammo... then they rush out and buy all they can, thus adding to the problem.
The way around it is to shop like a civilized person, not someone in a war zone. Or to order it in bulk online and wait for it.
Strangely enough, some stores want the largest number of their customers to get a limited supply product. Keeps people happy leaving the store.