If you divide the flavor by the cost, they come out as a compelling snack option for us working-class folk.
Most other nuts are better, but their superior flavor scales nonlinearly with the cost – definitely worse than O(n), probably about O(n^x). So for people that enjoy peanuts at approximately the population median value, they achieve more enjoyment by buying more peanuts compared to a smaller quantity of other, more delicious nuts.
So sort of the same reason more burgers are eaten in the USA than steaks. Or more instant noodles than braised abalone, in my part of the world.
Inasmuch as it’s hard to explain why I like anything, peanuts are filling, and taste like oil, protein and salt. They have a nice smell. A bit similar to roasted chickpeas, but richer and oilier.
Just for fun – Professor Science says that none of the items we are discussing are nuts. Cashews and almonds are drupes and peanuts are legumes.