J.C. Penney (JCPN.Q) just can't help picking at a scab. The company announced yesterday that it would appeal a New York Supreme Court justice's recent ruling that Penney's selling of Martha Stewart home goods violated an exclusive contract Macy's (M 0.10%) had with the domestic diva's company.

Two weeks ago I argued that the department store needed to put this case to bed and accept that former CEO Ron Johnson demonstrated poor judgment in signing on Martha Stewart Living Omnimedia (MSO.DL) to sell identical goods that were covered by the Macy's contract. After all, the retailer has all but admitted it was wrong.

After Macy's sued its retail rival and MSLO for tortious interference, Penney unbranded Stewart's goods, marketing them under its own "JCP Everyday" label instead; gave back the 11 million shares it had received in her company; and relinquished its two seats on Martha Stewart Living's board of directors. For all intents and purposes it was breaking with that bad decision, despite Johnson's contention that he believed MSLO had found a "loophole" in the contract.

Because Martha Stewart Living reportedly wanted to operate a flagship store of its own, Macy's contract allowed an exception for the creation of an MSLO store as long as it was "owned or operated" by the doyenne of domesticity. Since Penney would be establishing a store-in-store boutique for the goods, it was argued that that was a sufficient parsing of the exception to allow Penney to bring MSLO on board. That MSLO and Macy's ended up settling suggests the loophole wasn't as big as originally thought.

Justice Jeffrey Oing's conclusion that Penney had violated Macy's contract, despite having given the two sides ample time to reach an out-of-court settlement, isn't so surprising.

Yet even his decision against Penney wasn't wholly terrible, as the judge denied Macy's request for punitive damages. While Oing said a judicial hearing officer or special referee will determine the amount of damages and attorneys' fees to be assessed, he mocked Penney's raid as childish in nature rather than "wanton, reckless, malicious [or immoral]."" Sheer embarrassment at having been brought to the brink of financial ruin is penalty enough.

Penney should have just let sleeping dogs lie, as its appeal to the court's ruling on damages led Macy's to declare it would appeal the court's denial of punitive damages. Such damages could be high enough to bankrupt the retailer. That has been a concern -- the judge even stopped Johnson from answering a question about that possibility while giving testimony in the case -- and though Penney is somewhat more financially stable than during its downward spiral, it's not so safe that punitive damages wouldn't push it back over the edge.

J.C. Penney obviously realized the risk involved in signing up Martha Stewart Living, and ought to have taken its lumps. Now that it's chosen to stir up the hornets' nest again, investors may be the ones who get stung.