Is there some law against selling the stuff in working
condition?
Probably not, just as there are probably no laws against keeping a dog
in your appartment. But that doesn't mean there can't be a binding
agreement that has significant legal weight. Your lease might say "no
pets", and the scrapping agreement might say "no resale in working
condition". And the law says such agreements are enforcable.
The law does explicitly prohibit some agreements (slavery, opium
futures, minors signing any contracts), but competent adults are
allowed to agree to anything which isn't specifically prohibited.
The welfare of children has legal protection, the welfare of old
computer hardware does not.
-kb