So if you get the room you really want, why should another person get stuck paying more for a worse room? You might say that the landlord should just give the apartment to the people who want it the most, and only charge what they can afford to pay him. But the landlord isn't looking to maximize desire, he's looking for the most money.
So really, the reason the solution is to give more desirable things to people with more money, is that the owner of the desirable thing is looking to maximize money, not just match desire of the apartment with desire of your money. So he's trying to take the most money the rich person is willing to give and the most money the poorer person is willing to give.
In practice it's usually the tenants picking the rent split, not the landlord. Two friends move in, they agree that they'll split the rent roughly equally, but maybe the bigger room is worth an extra $50 or something. Often they'll just split the rent equally despite an obvious difference in objective quality between the rooms. This is because when it comes to family and friends, we often behave in anti-capitalist ways. This is why the idea of capitalism seems "cold" and "uncaring", because when it comes to those close to us we don't act strictly capitalistically.
Sure they decide among themselves what the split is. But I mean, if the richer person is willing to pay $750 for the better room and the poorer person is willing to pay up to $500 for either room, the best move for the landlord is to raise the rent overall!
So really, the reason the solution is to give more desirable things to people with more money, is that the owner of the desirable thing is looking to maximize money, not just match desire of the apartment with desire of your money. So he's trying to take the most money the rich person is willing to give and the most money the poorer person is willing to give.