Is it illegal to marry for green card?

Is it illegal to marry for green card?, That said, the practice of obtaining residency through marriage is illegal in the United States if the marriage itself is fraudulent. A marriage that is solely for purposes of obtaining legal residence is considered a sham, and is a crime in the United States for both participants.