In DotA 1 in the early years the default mode (called "normal") would have limited both sides (Sentinel and Scourge in DotA 1, Radiant and Dire in DotA 2) to pick the heroes their sides are connected to. There was even a third party neutral which would be offered to both parties to pick from.
At some point the mode All Pick was introduced which allowed to pick any hero. Balancing was not done for this kind of setup at the start but since the mode became the most popular in public games DotA 1 started to get balanced around this mode until Captains Mode was the main focus of balance. Because All Pick became so famous there was no longer a need to have parties per se. I guess Sentinel and Scourge were kept to keep the theme of the game (Defense of the Ancients) and the lore (good vs evil) while the neutral party was split and added into the remaining two parties that you can see today.
In DotA 2 these sides have no effect anymore other than being part of the lore or until Valve/Icefrog decide to include the modus -normal again.
Even more detail:
In Warcraft III (the normal game) you would pick heroes depending on your race(human,orc,etc) from your own altar. Furthermore you were able to purchase neutral heroes from taverns (everyone can access those).
The concept to buy heroes from taverns and to have neutral heroes in the first place was copied into DotA 1.
Here are three pictures representing DotA 1 hero selection showing the evolution of Taverns (examples):
Upper left picture shows that back in v6.09 each faction/side had its own taverns(3).
Upper right picture shows that later in v6.60 all taverns were stored in the upper left corner of the map. Each side of the triangle has 3 taverns which stand for an attribute (strength, agility, intelligence) and within each tavern lies one faction (sentinel, neutral, scourge).
The last picture shows the modern arrangement (v6.70) of the taverns without the neutral faction. From left to right we have two sentinel and two scourge taverns. From top to bottom we have strength, intelligence and agility.