Some know don't have a bank account because they simply don't trust banks. They want to have access to 100% of their money 100% of the time.
Some don't have a bank account because they don't have income (adult dependents)
One didn't have a bank account because she was a minor and there was no adult around willing or able to open one for her to use.
When I was a kid I knew of a few adults who had bank accounts closed on them for check kiting, including my parents - I know of this because I overheard people talking about it quite a lot. I don't know what ended up happening after that, if they were able to open a new account or what. I know you probably wouldn't be able to open a new account nowadays with Chexsystem and the like. Of course, check kiting also isn't a thing anymore either.
However if your in the US and having trouble with the banks I’d recommend looking for “millennial” banking which is usually zero fee, but you can’t write paper checks and they are remote only.
My wife was paying almost a thousand a month in fees at a regular bank, after I moved her to one of the millennial banks she really prospered. She can’t overdraw the account anymore - and it’s not really an issue since the bank is no longer taking half her paycheck.
There may be minimum balance requirements and/or fees but if you shop around a bit (look especially at local credit unions) they are not onerous and are almost certainly lower than what check-cashing services will charge. They do demand a bit more management and responsibility compared to a wad of cash in one's pocket, but that's the way life is.
Cause I've been denied by two banks, the third bank even had two countries blacklisted.. that's right, on their official website they wrote: "we are currently unable to accept government issued IDs from X and Y" or something along those lines.
The solution lay in busting bias and fixing immigration laws though, not banking.
I grew up in rural america and worked part-time alongside illegal immigrants, so yeah, it is true even if we're using anecdotal evidence. Your Walmart anecdote is an example of survivor bias.
Historically (in the U.S.) it was rooted in racism post-U.S. civil war. Now, less so. The history is still there, and the inability of poor people to obtain an account still exist. It excludes people from getting mortgages, loans, investing, etc. Cash App has become a digital bank for many of the unbanked. Before Cash App, decades ago, we had the U.S. Postal Service providing some banking services to Americans. (No, the USPS attempting to help Americans in this manner is not new, we've done it before)