A tangible program is not what's being patented, only the concept of the program, which is not tangible. Concepts are patented, not code. Code gets copyright protection.
Similar to saying, "Hey! I thought of a cure for cancer. I didn't actually come up with a specific one, only the concept of one. If you actually come up with it, it's my property and I'll sue you if you don't recognize that.
This means that there are trivial concepts out there, that if I implement in software, I owe bank to some company. It's pretty fucked up when you think about it.