She really shouldn't have done such a thing.

Literal

She [topic-は] that-kind-of thing [object-を] [shouldn't have-しなければよかった] [it's a shame-のに].

~なければよかった is the past-directed regret pattern, literally 'if (one) hadn't, it would have been good' — meaning 'should not have, wish (one) hadn't.' The trailing のに sharpens the regret further, leaving an unspoken 'but she did anyway, and now it's a problem.' Note the structural pair: ~ばよかった ('should have' + positive regret) and ~なければよかった ('should not have' + negative regret) are cousins. The combination ~なければよかったのに ('she shouldn't have done it, yet she did') is one of Japanese's most economical ways of expressing 'I told her not to' or 'what a shame.'