You buy life insurance to give your family some financial support after you die. The last thing you want after years of paying premiums is for the IRS to siphon off some or all of the benefit to wipe out back taxes you never got around to paying. In most cases, this doesn't happen, but there are exceptions.
Unless the life insurance policy is part of the estate and has no listed beneficiaries, the IRS cannot take it to pay back taxes. It belongs to the beneficiary.
When your spouse or partner dies owing taxes, the IRS or a state department of revenue can put a claim on his estate along with his other creditors. Part of the executor's job is to pay off all the debts before you and other heirs see any of the money. The IRS can suck the estate dry to pay for back taxes, but that's all it can do: If the estate doesn't have the money to settle the tax debt, the government has to eat its losses.
If the deceased named you as her life-insurance beneficiary, the money goes straight to you, without passing through probate. Even if the estate can't cover his back tax debt, you get to keep the money. If the estate is the beneficiary or the deceased didn't name a beneficiary, however, the death benefit becomes part of the estate. The IRS can then seize it for unpaid debts, just as it can seize other estate assets. So can other creditors.
If the deceased took out a life insurance policy on herself, at her death the benefits count as part of her taxable estate. The IRS still can't touch the money if you're the beneficiary, but it adds to the value of the estate. If that makes it large enough to pay estate taxes, the executor will have to pay those as well as the deceased's debts before you and the other heirs see a penny. More than 90 percent of estates are not big enough to pay estate tax, however.
If you're the deceased's spouse and you filed joint tax returns, the law makes you liable for each other's tax bills. When one spouse dies owing back income taxes, the IRS can come after the other if the estate can't pay the bill. If the debt is substantial, you may have to use the life insurance payout to settle the bill. The exception is possible if you can claim "innocent spouse" protection: if you show you weren't responsible for the debt and didn't know about it, you may escape paying.