A statue of limitations serves a few purposes.
1. At some point closure is better than justice, or at least, that's a theory. Better to get a crime on record because the committer of it confesses to it than not. The idea being that after, say, 10 years, the odds that the criminal would get caught have drifted off to as near to 0 as can be.
2. Records eventually get shredded if you wait long enough; eyewitness recollections in particular slowly mutate into conjecture (whilst said eyewitnesses will believe what they remember is accurate, there's plenty of proof out there that given enough time what they remember is not at all accurate and it gets worse over time). This makes it easier to accidentally convict on flawed evidence, and makes it harder for the defendant to defend themselves.