If they can cover, and never do, they quickly stop getting hung out with. This is generally true, in my experience.
If they can’t cover and never do, that’s fine - you simply take the L and call it an “investment” in the experience of sharing time with someone you care about.
Bingo! Not all friends are in the same strata, unless one prefers to travel in a narrow socioeconomic bubble. Some are above, and if they offer to cover my meal, I'm happy to accede. Others are below, and for them I always offer to cover their meal. It may not seem fair, but is ultimately just.