It is actually not surprising that we never get good immunity to malaria. The ancestors of malaria parasites were parasites of animals for ~0.5 billions years ago. The parasites were in animals when the immune system was invented. The parasites are locked in an arms race to avoid being eliminated.