@ddljohn-- Except for acquired immonodeficiency diseases, like AIDS, I believe all of them are caused by a missing gene that prevents the immune system from working.
Scientists have even tried to replace the gene with some immune deficiency patients. But the results weren't too good. It worked for some but the complications were too much in others. So they've left this treatment option for now. Hopefully research will lead to better treatments soon.