You can stretch the definition of legal and head the abandonware route, some companies even provide windows 2k/xp updates for these and some companies even donate/support it.
Likewise a lot of the old doom and slightly more recent era FPS titles had their source released although normally not with any level/graphic data meaning 3rd party is normally necessary (even then it is a bit sketchy).
A lot of companies give the full multiplayer component or a client (i.e. you can not host) of the game of their game (normally FPS titles but occasionally some others).
The odd MMO title also does free stuff but look carefully.
Various agreements also preside over emulation (normally stuff where a developer licensed and published a game through a company and said company gained the rights before giving them away to the community).
Oh and my favourite Frontier First Encounter:
http://nic.dnsalias.com/FFE.html
Similar to above:
http://www.game-warden.com/bsg/about.html
A lot is out there if you know where and how to look.
Edit: if you are after gaming on the cheap I strongly urge you to also consider those $/£5 shelves in game/electronic/supermarket type places as the games they offer tend to be good, require a modest PC to run (by todays standards anyhow) which also means network games, are fully patched and stable most of the time and last and most certainly not least frequently have devoted modding sites/communities.