What love requires of us is often very different from what the "law" requires. Joseph had a choice to make when confronted with Mary's pregnancy--he could obey the law or divorce her quietly. He chose option 3: Love.