Actually, many journals, even quite reputable ones ask for money, but the good ones expect that the authors are funded by grants that will cover publication costs. On the other hand there are "predatory" journals that seem to exist only to publish relatively low quality papers and make money in the process. They are like "vanity publishers" of novels and such, but do provide an audience of sorts, including web publishing, for example. Beall's List is now somewhat out of date, I think, but you can find many predatory journals here. Most of those are best avoided as people finding your papers there will, at least, wonder why you couldn't have done better.
I don't know current practice, but even the AMS used to charge (page charges) for paper they publish in some journals. It means that the cost of publishing isn't entirely borne by members of the society. The bill would normally be sent to the author's grant. If there is no grant then it would be sent to the author's institution. If it was refused there, it would be sent to the author. But if the author wasn't able to pay the fee, then (in the past at least) the paper would still be published. It wasn't a condition of publishing, but a request.
If you are writing grants, include something for publishing fees unless it isn't permitted or isn't needed.
But note that there are costs associated with publishing, even if it is mostly done by volunteers and publishing is online. Someone need to pay for the web site and the space to host the papers. These costs need to be paid somehow.