Lots of people do. McDonald's franchise owners do the same, as do CVS pharmacies, iirc. It's for capital efficiency, and it especially makes sense in markets where the land is very expensive like Manhattan, or for a business that is trying to expand rapidly. Instead of borrowing (for illustration sake) $2 million to buy a lot and building, you can have another party buy the land for $1 million and then you only have to borrow $1 million to build the building. Your total debt is now $1M instead of $2M. You now have another $1M in lending power to go open a second location.
Why not lease the building, too? In the case of McDonald's I can imagine it's because only McDonald's wants the specific building (which looks and serves a purpose specifically like a McDonald's), but if it's a generic office building, why wouldn't you prefer to lease both the building and the land it's on (assuming you prefer to lease at all)?
When it's a generic office building, businesses frequently do lease them, unless they have so much free capital (like Apple, Facebook, etc) that they can build a custom building for themselves as a long-term HQ. But you're right with McDonald's and many franchises they have to build with a specific architecture style that's custom to their brand.
Property taxes in NYC are high enough that owning the land doesn't really save you much the way it does in most places.