SB 6.1.67

yad asau śāstram ullaṅghya
 svaira-cāry ati-garhitaḥ
avartata ciraṁ kālam
 aghāyur aśucir malāt
yat — because; asau — this brāhmaṇa; śāstram ullaṅghya — transgressing the laws of śāstra; svaira-cārī — acting irresponsibly; ati-garhitaḥ — very much condemned; avartata — passed; ciram kālam — a long time; agha-āyuḥ — whose life was full of sinful activities; aśuciḥ — unclean; malāt — because of impurity.
This brāhmaṇa irresponsibly spent his long lifetime transgressing all the rules and regulations of the holy scripture, living extravagantly and eating food prepared by a prostitute. Therefore he is full of sins. He is unclean and is addicted to forbidden activities.

Food prepared by an unclean, sinful man or woman, especially a prostitute, is extremely infectious. Ajāmila ate such food, and therefore he was subject to be punished by Yamarāja.