How to make crime meaningful for rich players?

For the D&D 5e campaign I’m DMing, the party has been caught for a murder of a government official and put on trial. Out of character, a player pointed out that his character can just pay for a Resurrection to be cast, absolving them of the crime. I pointed out that the trauma would still be criminal, and he responded that he can just cast Modify Memory, so the person will have no memory of the incident (which could be beneficial to both parties; the option to not even remember a traumatic experience seems pretty tempting to me).

How do I handle the consequences of a murder as a DM? If the person is restored to life and no one remembers the murder, it seems like no crime has been committed.

More broadly, most crimes I can think of can simply be fixed with magic. Assault (and even some more heinous crimes I won’t mention) can be "fixed" with healing/modify memory. Rejuvenate / reincarnate will even restore body parts.

A mending spell applied repeatedly can fix some types of property damage.

If you could find a wizard/sorcerer willing to do it, a Wish spell could "fix" pretty much anything.

The important players here are a cleric and wizard(the wizard started the discussion with me). All level 13 (so they have access to 7th level regenerate). The cleric chose the noble backstory, and has a good bit of gold to burn.

Ultimately, my broadest question would be: how do I make laws apply to (rich) players who seem to be able to use magic to "undo" crimes committed? While I have D&D 5e in mind, any sufficiently powerful magic system would appear to have this problem as far as I’m concerned.