NO! It is absolutely not ok to get married for papers. In addition to proving that you have a valid marriage (as discussed previously) you must prove that your marriage is bona fide (ie: you did not get married for the purpose of avoiding immigration laws). If you get married for the purpose of getting a green card or some other benefit, you will not get a green card. Immigration authorities take immigration/marriage fraud very seriously and will check for proof that you have a bona fide marriage. It is not their responsibility to disprove a bona fide marriage, it is your burden to prove a bona fide marriage.
Additionally, not only will you not get your greencard, you will likely be deported and one or both of you may even be prosecuted for fraud. So, getting married for papers is really not a good idea. DON’T LISTEN TO YOUR FRIENDS WHO TELL YOU OTHERWISE.
For legal advice about your specific issue, contact a competent attorney. Additionally, if you are in the process of getting your greencard or other paperwork in order and are served with divorce papers, you should talk to an immigration attorney to see what options you may have.
This is general information only and not legal advice. No attorney-client relationship is created by use of this site.