From what I have read some dinosaurs (the ancestors of the avians) used to lay their eggs in the sand and bury them and would leave them to go feed and come back to check on them and protect them. But that left their eggs vulnerable to predators. But some dinosaurs would stay with their eggs in order to protect them while their mate with to gather food, these dinosaurs had a much better chance of survival and passes on their alleles. Nesting sites also changed, instead of laying them in the ground, some dinosaurs would nest in high places like rocky crags and such and eventually our good friends the feathered dinosaurs would nest in trees.
It's pretty simple stuff, I don't understand how anyone can seriously dispute how nesting developed.