Why do vanity journals exist?
We do not call them "vanity journals."  We call them "predatory journals."  They make their money from people who do not understand how journals work.  Their customers do not know that anybody can set up their own fake journal website.  The person who is fooled by the predatory journal might be the author, or it might be the person responsible for evaluating the author's publication record.  Ego stroking is not as relevant.

They continue to exist because they are profitable.