This is a quote of Thomas a Kempis (1380–1471) who was a German medieval Christian monk.
Basically, it means that if we are ever faced with a situation wherein a choice between two immoral acts must be made, then we should always choose the least harmful of the two.