It is hard to work out why some animals have one feature and others have something different. All we can say is, if it was common, it had, at worse, to be no problem, and at best, to be something useful.

Every natural think in the world varies. This means there is always a natural tendency for each living thing to be different. So, over time, a slight change in one animal might become more pronounced in its descendents. If it doesn't matter, it will simply continue. If it is a real problem, that line will probably die out. If it is useful, that feature will continue. Just remember that features do not have to be for eating or defence. They can also be for courtship and other purposes. A tall plate sticking out of the top of the head might have been very attractive to another dinosaur!

This is probably the case with all of the bony combs (on top of the head) and frills (around the neck). They may be useful for defence against attack, to show off for protecting territory, or to show off in courtship.