It may or may not be
criminally illegal (which is the way many non-lawyers consider the term, that is, subjecting an offender to prosecution and possible jail), but it most definitely is a violations of the Terms and Conditions of most or all frequent flyer programs, to which you agreed by participating.
Thus, it is a breach of contract, or civilly illegal, if you will. Remedies by the carrier could include seizure of the ticket, charging the passenger the full fare, confiscation of all frequent flyer miles, expulsion from the frequent flyer program, monetary damages, and possibly expulsion from using that airline in the future.
I suggest we continue the discussion on illegality in the primary active thread on this topic.
Warning/Confession: I was caught selling miles!
http://www.flyertalk.com/forum/Forum1/HTML/008571.html
As to how far an airline can actually go, including whether its common carrier status limits the ability to bar an offender from future travel, there is still a fairly current ongoing discussion in this forum.
US Airways bans writer, confiscates miles after negative column
http://www.flyertalk.com/forum/Forum.../009531-6.html