Remember that the NFL (MLB, too, but not quite so much) is a multi-billion dollar enterprise. Those corporations will pay millions of dollars—tens of millions in some cases—per year for the right to have their name on that stadium (and thus get mentioned on well-watched national TV every time a team plays there).
It's also part of a shift in the whole idea of stadium making. They used to be works projects, buildings built for civic use. A lot of them were built as memorial monuments (hence why you saw a lot of "Memorial Stadiums" in various places), since many of the earliest baseball parks and football fields were chinsy and made of wood. Of course, back then, pro sports was not as profitable, as there was no TV and attendance wasn't as high, nor were ticket prices. Now, with these teams being billion-dollar enterprises, it seems more like corporate welfare to build these huge stadiums. What used to be done by the WPA is now done by private construction.
Ironically, one of the first stadiums to have it was the stadium in Buffalo. For dirt cheap, Rich Products bought the naming rights to Rich Stadium. Then, after 25 years, Ralph Wilson decided things have gone too far. So he decided not to renew the deal and slapped his own name on the stadium! (He didn't even own it.)