I agree about population making a big difference. But here is another tip to consider or research: cities or counties that provide a free "park" where people can camp for a period of time. These places are usually trying to attract tourists/campers to stay overnight or more and spend some money on a meal or whatever.
This night, I'm at such a place just a mile or so north of Townsend, Montana. It is at the southern end of Canyon Lake (and I think this is built by the Bureau of Reclamation but it may be maintained via the city or county???). It has brick housed vault toilets, water pumps and trash cans. The overnight area is a circle with curved places to pull to the side and each has an iron fire pit and a concrete picnic table. Little shade but the day use areas have more trees. Totally free and you are guaranteed no hassle unless you are doing something you shouldn't be. Sooooo much better than a Walmart parking lot for a quick overnight (like my planned visit to Helena to the north for a cheap and quick haircut tomorrow LOL). And I do patronize the local restaurants and Bob's Thriftway grocery. They also have the Townsend Ranger District office here so I dropped in there for more local scoop.
Another place I stayed a few days and I had used years before is in Columbus, MT. Larger campground right on the Yellowstone River. Again, toilets, water and dumpster. Free or they do have a donation box (not required). There are shade trees at most of the sites.
Even NM has one I used years ago.... the tiny village of San Jon, NM right at an I-40 exit. There is a sign with rules but basically you just park in a designated spot of your choosing.
You can find more of these if you are patient at using apps like freecampsites.com