Apparently, the ABO blood groups are related to susceptibility to different pathogens.
See for example:
Fry AE, Griffiths MJ, Auburn S, Diakite M, Forton JT, Green A, Richarson A, Wilson J, Jallow M, Sisay-Joff F, Pinder M, Peshu N, Williams TN, Marsh K, Molyneux ME, Taylor TE, Rockett KA, Kwaitkowski DP: Common variation in the ABO glycosyltransferase is associated with susceptibility to severe Plasmodium falciparum malaria. Hum Mol Genet. 2007, 17 (4): 567-576. 10.1093/hmg/ddm331.
Mourant AE, Kopec AC, Domaniewska-Sobczak K: Blood groups and diseases. 1978, Oxford: Oxford University Press
Borén T, Falk P, Roth KA, Larson G, Normark S: Attachment of Helicobacter pylori to human gastric epithelium mediated by blood group antigens. Science. 1993, 262 (5141): 1892-1895. 10.1126/science.8018146.
Swerdlow DL, Mintz ED, Rodriguez M, Tejada E, Ocampo C, Espejo L, Barrett TJ, Petzelt J, Bean NH, Seminario L: Severe life-threatening cholera associated with blood group O in Peru: implications for the Latin American epidemic. J Infect Dis. 1994, 170 (2): 468-472.
It because of human's demographic natural selection events against different parasites, especially Malarial plasmodium shape it well, you may deeply read this from below articles,
Mayer, D.C. et al. (2009) Glycophorin B is the erythrocyte receptor of Plasmodium falciparum erythrocyte-binding ligand, EBL-1. Proc. Natl. Acad. Sci. U.S.A. 106, 5348– 5352 5.
Maier, A.G. et al. (2003) Plasmodium falciparum erythrocyte invasion through glycophorin C and selection for Gerbich negativity in human populations. Nat. Med. 9, 87–92 6.
Cserti, C.M. and Dzik, W.H. (2007) The ABO blood group system and Plasmodium falciparum malaria. Blood 110, 2250–2258 7.
Rowe, J.A. et al. (2007) Blood group O protects against severe Plasmodium falciparum malaria through the mechanism of reduced rosetting. Proc. Natl. Acad. Sci. U.S.A. 104, 17471–17476.
Malaria Genomic Epidemiology Network, Band G, Rockett KA, Spencer CC, Kwiatkowski DP. A novel locus of resistance to severe malaria in a region of ancient balancing selection.Nature. 2015 Oct 8;526(7572):253-7. doi: 10.1038/nature15390. Epub 2015 Sep 30.