Formal nights on ships need not be a problem for women because there are so many interpretations of the term 'formal'.
I make do with a set from Travelsmith. It's a pair of black, pull-on pants, a black shell and a black jacket. All are in a fabric that you can ball up and throw in a corner of the suitcase without damage. I usually don't wear the jacket but add a colorful jacket I already own and an inexpensive necklace to the other pieces. The result is perfectly acceptable for a formal night and it's as comfortable as an old bathrobe.
Also, on ships you will almost always encounter the 10 dollar sale. Evening bags, shawls and jewelry sets are staples. It's an easy way to dress up an outfit for formal nights and doesn't break the budget.
For formal nights, men are expected to wear at least a jacket, tie and long pants. Since the air conditioning on ships is often fierce in the public rooms, most men don't object too much.