Most states DO NOT allow overnight stays in rest areas. Just a few of them do such as New Mexico.
You can download an app called "State Lines" that will tell you what states allow what.
Not all Walmarts allow over night stays either. There's an app called "Allstays" that will tell you which ones do and which ones don't. In addition to Walmart, you can always consider Camping World, Cabelas and a few other big box stores.
I'd also recommend the "Days End" guide by Escapees and also Harvest Hosts for lists of other possible overnight stops. Last week, I spent the entire week parked in a church parking lot (with permission, of course).