感染 means 'become infected' while 传染 means 'spread virus towards'. Therefore, the former is the result of the latter. For example,
Wǒ gǎnrǎnle bìngdú， yīnwéi wǒ bèi tóng shì chuánrǎnle
I become infected virus because I was colleague spread virus
'I caught the virus because I was infected by a colleague.'