Four experiments were conducted to explore how people allocate social resources between meritorious and needy parties. As predicted, participants with high social dominance orientation (SDO), who prefer hierarchical relationships in society, favored meritorious parties. In contrast, participants with low SDO, who value social equality, favored needy parties. Participants appealed to merit- or need-based ideologies to justify their allocations. Apparently, the notion of fairness denotes merit-based reasoning to people with high SDO, whereas it denotes need-based reasoning for those with low SDO. Among the participants, merit- and need-based ideologies were not simply post hoc rationalizations, but rather mediated the allocation decisions. Implications for the study of ideology and for theories of distributive justice are discussed.