Even with enough money, you may not be able to attract/keep talented engineers who are willing to put up with such a work environment (the codebase itself, and probably the culture that led to its state) and who want to ship well built/designed software but are slowed down by the mess.
When you work with F500s you end up seeing code and culture that is absolute balls and that I would never work directly for all the time. And yet roles are always filled. And when the economy gets bad, they have decent engineers.
I call it the fast food quality theory of economics. When the economy is good, low pay jobs tend to have low quality employees and it shows in their products. When the economy gets bad higher quality employees end up downgrading because of layoffs and the quality of these low tier jobs improves.