I understand all of the logistics for needing them around the globe. So they purchase the land? I'd have guessed a lease. Surprising the host nations aren't helping with costs or anything.
Whenever a space agency affiliated with NASA needs to use the DSN for one of their missions, NASA accommodates and grants usage of it. And obviously, the mission agency pays for this usage out of their own mission budget.
This goes the other way around as well. Since 2007, the DSN is closely partnered with ESTRACK, which is ESA's antenna network. There also are cooperations with JAXA and ISRO ( Japan and India). Sometimes their networks can help fill coverage gaps or offer better bandwidths.
Global cooperation really has its benefits.