When God first created the world, there were a lot of creatures with very long necks. Think Apatosaurus, Brachiosaurus, Supersaurus, etc. Now, think of the long-necked creatures we have today. Giraffes, antelope (like the kudu), elk, etc. The longest neck is the giraffe at 6.5 feet. Nothing compared to the 50-60 feet of neck from the sauropods.
Giraffes with longer necks have a higher mortality rate than those smaller-necked buddies when it comes to a food shortage. Scientists theory is that it takes a lot more nutrients to keep everything associated with it going. Therefore, when a food shortage occurs, the longer-necked ones die out sooner.
So, if this is happening now, with giraffes, what happened with the dinosaurs? Their necks were huge and they were huge. They weighed 90 tons and the giraffe weighed 2,930lbs. A huge (no pun intended) difference.
Well, as it turns out, this whole mortality rate thing is not completely accurate because of this fact: when shortages are in action, the giraffe has the advantage to get above everyone else and eat the higher food. So, their only competition is themselves. This is actually a great advantage to the giraffe and other long-necked creatures.
Now, as far as sauropods go, their food consisted of a high-nutrient food source called conifers. This needle-like food would give a sauropod enough energy that he wouldn’t have to eat 24/7. When you get down to stegosaurs, ceratops, ankylosaurs, etc. you have a different setup.
They may have eaten some of the same food, but they were limited to a much lower diet. Seeing as they were not as big, God did not need to give them long necks so they could eat the conifers. He only had to do this for the sauropods.
When it comes to animals, God knows what He is doing. If you believe evolution created everything, then please watch this video: