(Bloomberg Business) -- The U.S. Supreme Court just legalized gay marriage nationwide. If same-sex couples get married, they gain access to hundreds of legal and financial benefits.

They—and anybody else thinking about marrying—also bear some often-overlooked costs and responsibilities.

Even couples who have been together for decades may be surprised by how a legal marriage changes their relationship. In the eyes of the law, couples who marry go from two independent people to one economic unit.

“You’re telling the government: I will take care of this person legally and financially if something happens to them,” said Debra Neiman, a financial planner in Arlington, Mass. She saw many clients rush to the altar when Massachusetts became the first state to recognize same-sex marriage, 11 years ago, and it didn’t always work out.

“Just because you have the right to marry doesn’t mean you should,” Neiman said. “For people who are used to being financially independent and unencumbered, it may be hard.”

Still, the legal and financial perks of marriage tend to outweigh its costs and hassles. And the biggest practical benefits of marriage come when they’re needed most—when a spouse is sick or dies. How do you weigh the cost of higher income taxes each year—a possibility for many two-income couples if they get married—against the right of a widow to stay in her house or decide where her wife is buried?

So, coldly ignoring the whole happiness thing, here are some of the practical pros and cons of marriage.

PRO: RETIREMENT BENEFITS

Married people can share each other’s retirement funds and Social Security benefits in a way that makes planning a lot easier. If one spouse dies, the remaining spouse can inherit pension payments or Social Security survivor benefits. When you're married, it’s far easier to roll over a spouse’s individual retirement accounts or 401(k)s into your accounts after he or she dies. Marriage lets you deploy some complicated techniques to boost your Social Security payments—for example, by accessing one spouse’s benefit early but not tapping the other until he or she is eligible for the maximum payout at age 70.

PRO AND CON: INCOME TAXES

Taxes are complicated, but here’s one rule of thumb: Getting married tends to lower a couple's income tax burden if one spouse earns a lot more than the other. If a lawyer and a stay-at-home dad marry, for example, they’ll almost certainly save money on taxes. Couples can face a higher tax bill, however, if both spouses earn about the same. The marriage penalty can be especially high—in some cases, tens of thousands of dollars a year—if both are well-paid professionals with six- figure salaries. If you and your partner each make $300,000 a year, you’re paying a top tax rate of 33%. If you get married, your $600,000 will be taxed at 39.6%.

CON: GOVERNMENT BENEFITS

Because getting married can boost your household income, it may make you ineligible for certain kinds of help—financial aid for college, for example, or programs designed to make it easier to pay back student debt. The U.S. Income-Based Repayment program, or IBR, limits your student loan payments to a%age of your income. A single person making $40,000 a year, with $100,000 in student debt, might pay $280 a month. If that person marries someone earning $40,000 a year, his or her payment could jump above $700 a month. If the spouse makes much more than that, they may become ineligible for IBR altogether.

These sorts of calculations are especially important for older couples. Medicaid, the government health insurance program, can pay for long-term care expenses, but only if seniors are poor enough. It can make sense for a couple to stay single so that an ailing partner can qualify for Medicaid before his long-term care expenses bankrupt his partner.

PRO: ESTATE AND GIFT TAXES

When couples are married, they can seamlessly share money, possessions, and property between them. If one dies, the other can inherit everything and pay no taxes. For unmarried couples, it’s not so easy. If you give more than $14,000 to your partner in one year, you may need to file a gift tax return. If you die with an estate of more than $5.4 million and leave it to an unmarried partner, a federal estate tax can be levied, with a top rate of 40%. Estates that large are rare, but certain states have lower exclusions. In Massachusetts, estates of more than $1 million are taxed. Add up retirement savings and property and life insurance payouts, and that's a threat many well-paid professionals face.

PRO: PROPERTY OWNERSHIP

When they own property together, unmarried couples must worry about things that married folk take for granted. If one partner dies without the right will, or without life insurance to pay estate taxes, the other can easily lose his or her home. Also, one member of an unmarried couple may be helping pay the mortgage, but unless her name is on the title of a home, she’ll have trouble claiming a mortgage interest tax deduction on her taxes.

MOSTLY PRO: PARENTHOOD

A legal marriage can sort out a variety of issues faced by parents. For example, a parent often has had to legally adopt a child born to her partner. That may not be necessary anymore. There is one exception. Same-sex couples who are thinking about adopting overseas may want to stay unmarried for the time being. In countries where Americans adopt, officials often discriminate against gay couples and may be more open to a single person.

PRO: IMMIGRATION

If they’re legally married, U.S. citizens and permanent residents can get their spouses green cards that allow them to live and work in the U.S.

PRO AND CON: DIVORCE

Divorce can be expensive, and afterward a person can lose prized possessions to an ex or be stuck paying alimony for years. Then again, the process can be a lot fairer than no process at all, especially if there's a lot of property to split up. The rules of divorce can protect the financially weaker person in a breakup, such as the partner who had a lower-paying job but did much of the housework or parenting. A good prenuptial agreement can lower the risk that couples will end up in an expensive divorce fight in the first place, says BNY Mellon wealth strategist Justin Miller.

PRO: HEALTH CARE

Workers can usually cover their spouses through their employers’ health insurance, and sometimes they can get them dental and supplemental life insurance at work, too. (Some employers will cover domestic partners, but the employer portion of the benefit is taxed as income.) Married people can also cover their spouses’ health expenses through flexible spending accounts and health savings accounts. Married couples automatically get the right to visit their spouse in the hospital and make medical decisions on his or her behalf. If your spouse is sick, you have the right to take time off from work through the Family and Medical Leave Act.

CON: FINANCIAL FIGHTS

When you get married, you can be on the hook for your spouse’s debts and bad credit history. Marriage is an economic relationship, too, and can cause trouble if, for example, one person is a spender and the other is a saver. Love can keep you together. Money can tear you apart.

Read more: