For me, it definitely does cost more to eat healthy. Way more! The costs are related to the large amounts of produce I eat and produce can be expensive.
I don't just eat one serving of broccoli. I eat multiple servings of a variety of vegetables and fruits, every day. It adds up. My produce bill is quite high.
As far as beans and lentils, sure, they're cheap. However, if I eat too much of them, they pack pounds on me. I can't eat bowls of lentil soup or else I'll put on weight. But, I can (and do!) eat bowls of fresh produce.
It can be very hard for a person on a limited budget to get the recommended 9 servings of fruits and vegetables a day.