You're thinking of _free_ open source software. While I'm not a huge FOSS-head, there is a distinct difference between "_free_ and open source" and just "open source". It's all in the licensing.
I could, in theory, write a license that says, basically, you can't distribute my source code, but you can look at it, compile it, and even alter it to fit your needs. In fact, a lot of licenses on older software projects allowed for exactly that.
I could also release a license that says that you can only redistribute my code if you haven't purchased it, but if you have purchased it, you're not allowed to redistribute it. Pointless? Yeah, probably. But that's still a valid license.
Anything goes, as long as you can come up with the proper legalese to put in the license.
EDIT: I get it, some people support OSI's definitions, some FSF's, and apparently sharing the opinion of one has angered the supporters of the other. A lot of this is subjective, and I know that. I'd appreciate it if you discussed and voted accordingly.