Is selling miles/points legal?
I don't think it is illegal to sell miles or points, rather it is a breach of the terms and conditions that you agree to as a member of the loyalty program.
Airlines can sell what they want, and can make deals with other companies to sell on their behalf. They just don't want _you_ to sell them as you are the end customer.