I fully agree with your analysis, 1KDAN. The term "illegal" is ambiguous. Its broadest meaning would include a breach of contract. Usually what we're talking about with money for miles is nothing more than breach of contract. It is not necessarily immoral to breach a contract. Indeed, many contracts law scholars believe contracts should be breached under many circumstances.
However, I think most people understand "illegal" to mean criminal. The airlines make the most of this ambiguity, and discourage the "illegal" sale of miles. If lots of folks imagine a sentence in the Big House for selling miles, that's okay by the airlines.