It comes from the old days. Back then, you'd roll stats first, and according to what you rolled - you'd then pick a race, and then a class.
Races had modifiers for these stats; ie. A Dwarf gets +1 to CON, Elfs get +1 do DEX, but there were also class restrictions to these races. There's no such thing as a Dwarven Mage or an Elven Bard in AD&D.
Certain classes were *hard* to attain as most classes had flat out requirements. So in AD&D for example, Paladins were stupid rare, mostly a pretige class as they required 17 Charisma and 14 Wisdom, but didn't use either ability for anything. With low Strength for attacking, low Dex for defense or low Con for HP, you were a terrible Paladin. So you'd only have Intelligence as a dumpstat.
Nowadays, it makes far less sense as you just pick and choose. But, I do admit that I quite like the idea that what-you're-capable of physically - by just existing - is what defines what you can go do effectively for a living. As in; I can, with my intelligence and poor eyesight - never be an Astronaut.