You don't need to make your heart and your head agree. Let your head make the decision, your heart will catch up eventually.
Legality alone is no guide for a moral people. There are many things in this world that have been, or are, legal but clearly immoral. Slavery was legal. Did that make it moral? South Africa’s apartheid, Nazi persecution of Jews, and Stalinist and Maoist purges were all legal, but did that make them moral?