She didn't have to pay that money.

Literal

She [topic-は] that money [object-を] pay necessity [topic-は] did-not-exist [but-のに].

~必要はなかった + のに combines two pieces a learner meets separately: 必要はない ('don't need to') and のに ('but / even though'). Together they produce a regretful 'didn't have to, but...' shape. The trailing のに hangs unfinished: 'she didn't have to pay it, and yet [...]', leaving the listener to fill in the implied frustration or sympathy. Sentences ending mid-thought on のに are deeply characteristic of spoken Japanese, packing a subtle emotional weight into what looks like a fragment. The choice between just 払わなくてもよかったのに and 払う必要はなかったのに is one of degree: 必要 makes the lack of obligation more explicit.