Well the not-so-useful answer is that it's a good idea to rewrite a codebase if it'll save effort in the long run, and the company is in a good position to make long term investments.
So some considerations:
- Keeping terrible code and starting from scratch aren't the only two options; gradually fixing things is another one.
- If it's mainly maintenance without many new features, having better code probably won't save much time.
- How terrible it is, and in what way, affect the choice. I.e. code duplication can be solved gradually. Making columns unique can be tricky, but you probably couldn't throw away the data even if the code is rewritten, so might as well solve that gradually.
- Code that is badly written looks like it didn't take much time, but there's likely a large amount of bugfixing time in there. Some of the bugs are due to bad code, but others will pop up again if you start from scratch.
This old article by Joel Spolsky is interesting.