There's a two step process needed here.
- Say to your players what you just said to us
- Then mind your own business
Have they not noticed that imbalanced loot is throwing off their party balance? Or is it that they don't care? If they do not care and are having fun, it is not a problem. If they haven't noticed, then just telling them "Hey gear is important to power in Pathfinder and have you noticed that the way y'all are going about it is keeping some characters really loot poor?" should be sufficient.
For some groups, loot distribution is not some game rule thing where you must ensure adherence to "wealth by level," it's a roleplaying exercise because it's an in character activity. If they're a bunch of CN Vikings then "first with your hands on it gets it" is a perfectly viable treasure distribution practice.
I disagree with most of the other answers here that there's some burden on you to go stick customized magic into the poorer PCs' pockets until they are matched up. There's nothing wrong with personalized rewards (with in game justification) but a) that doesn't scale to someone's whole loadout and b) it's not healthy to do that when they are deliberately unbalancing the gear anyway (they end up getting way too much gear if you are pouring in more gear to make up for a minority of the group getting most of it).
I've been in groups where the party decides to distribute loot in a wide variety of ways - and it's not always constant in a group, it's what makes sense to the characters. In my first pirate game, for example, there was a complex ruling on who got to pick items from the loot in what order based on job title on the ship encoded into the crew's Articles. "Our raid got 10 items? Well the choice order is captain, first mate, quartermaster, master gunner, carpenter..." In my newest pirate game, there's a quartermaster who instead doles out virtual shares to all in cash and they have to "buy" specific items which are otherwise liquidated. I mentioned to them that this has a downside - if I give them high power magic items they are inevitably liquidated for gold instead of being used for their intended purpose - but they don't care, and in the end character activities (including loot distribution) are the players' business, not the GM's.
In one campaign of ours, one player wasn't bothering to gear his caster character up well at all and the other characters sat him down had an in-character talk with him. "Dude, you're starting to not be able to affect our enemies, do you need some money for some magic or something?" In the games where groups hand out magic according to their need, it's always an in-character discussion. Because differential power levels are not a player/metagame issue, they're a character/in-game issue.
But what about encounter design being hard because of a mixed-gear-power group? It only makes designing encounters hard for you because you're inappropriately trying to compensate for player behavior. Design your encounters, and if they are too hard for the people with bad gear and they get beat up while the people with good gear skate through, it will encourage them to address the gear disparity in the interests of "everyone being able to pull their weight." You're not their mom, you don't need to "serve balance" - you are attempting to control something that's hard and frankly undesirable to control and that's what's frustrating you. Stop, and let the burden lift from your shoulders. It's not your job to compensate for every decision, good and bad, your special little snowflakes make.