That depends on what you choose to call a nest. Most birds that nest on the ground only scratch a depression and do not line it. Many birds use nests made by others. Waders usually use no nest but...
To protect them from everything that can eat eggs but can't fly or climb trees.
To stay away from predators
A tree provides shelter from enemies. They can fly to it when others can't.