The thymus is an important immunological gland located in your upper chest that produces T cells. These are important white blood cells of the immune system. This gland begins to deteriorate after you hit puberty, though it doesn't fully degrade until old age at which point it essentially becomes non-existent. This is the reason why with aging it becomes harder to heal from illnesses and why young kids tend to bounce back faster after illnesses.
Basically, our immune system starts to shut down as we get older because we’re simply not meant to live so long. There's no biological reason to live very long, just sentimental reason.