Why did dinosaurs swallow stones?
For the same reason that chicken swallow grit. Not all dinosaurs could move their jaw from side to side which meant that they could not chew their food. They swallowed the food whole along with small stones or gastroliths which helped grind the food while it churned about in their stomachs.