How do you know they paid? When I was a frequent flier I'd always get upgraded on short flights because... No one paid for first class on those flights but the airline could consume an upgrade.
If you have a long layover, flying business or first on any leg gives you (or used to) access to the premium lounge, so sometimes you can recover what you pay for the upgrade, but most of the time they give them to the gold or whatever members who are flying
Upgrading on those short flights is usually less than $40. If you have a long layover you can definitely get your money back. Even just being able to sit in a comfortable chair adds some value
I've never seen an upgrade that cheap, but the shortest flight I've ever taken (and actually frequently take) is 90 minutes - and the upgrade cost is still an order of magnitude over $40.
I've seen $40 a few times with Delta during check in on flights of less than 2 hours. I guess it's like a last minute deal trying to sell the upgrade instead of giving it to someone with premium status