Yes, prevention.
For example, there are two broad reasons why people steal items:
- they were unable to obtain the item,
- they have a mental disorder (i.e. kleptomania)
with the first reason, you have the following options:
- make the item more accessible (e.g. make the item cheaper, or lift any bans and stigma with the distribution of the item)
- eliminate the need for the item (e.g. provide a substitute)
Therefore, to reduce thefts, the state should start by eliminating poverty and providing sufficient resources for everyone.
Another example, rape. There are two broad reasons why people rapes:
- they were unable to obtain their preferred sexual gratification,
- they have a mental disorder (i.e. predisposed to violence or power conquest)
with the first reason, you have the following options:
- make their preferred sexual gratification more accessible (e.g. eliminate any bans and stigma associated with out-of-wedlock, same-sex, polygamous, underage, inter-generational, inter-race, incest, fetishes, BDSM, etc)
- eliminate the need for sexual gratification (e.g. castration, or hormone drugs)
Another example, murder. There are two broad reasons why people murder:
- they were unable to fill their hatred,
- they have a mental disorder (e.g. psychopaths)
with the first reason, you have the following options:
- make the hatred easier to fill (e.g. fair and efficient justice system)
- eliminate the need for hate (e.g. prevent hate)
Now this lefts us with only mental disorders. You can't really blame someone from having a mental disorder, and most (all?) mental disorder cannot be cured, however you can provide support to prevent them from actioning on their disorder. You can probably eliminate the existence of mental disorders though, by eliminating the bans and stigmas associated with abortions and making prenatal DNA testing of all genetic mental disorder more widely available.
I think the pattern starts to get obvious here, all crimes happens either because there is a need for something or because they have mental disorder. If the crime happens because of a need, then there is two ways to solve it, either by making it easier to fulfil the need or by eliminating the need.
I think by now it's also fairly obvious that it's going to be really difficult for a State to completely eliminate illegalisation. Way too often, making needs easier to fulfil or eliminating those needs is either impossible to achieve or conflicting with widely held moral frameworks or contradicts with the State's goals.