G‑d then informed Moses of the corrective punishments for engaging in the relationships that were forbidden at the end of the preceding section of the Torah. After concluding these laws, G‑d stated that the Jewish people must observe them because “I am G‑d.”
Whom to Love
אֲנִי ה' אֱלֹקֵיכֶם אֲשֶׁר הִבְדַּלְתִּי אֶתְכֶם מִן הָעַמִּים: (ויקרא כ:כד)
[G‑d instructed Moses to tell the Jewish people,] “I am G‑d . . . who has distinguished you from other peoples [by giving you My laws].” Leviticus 20:24

Feelings of love toward another person can be very strong. So strong, in fact, that they might cause us to consider defying the Torah’s prohibitions or even forsaking G‑d altogether if we become attached to someone forbidden to us. G‑d therefore reminds us that He, the creator of the world and the source of love, issued these prohibitions, so we should not expect any positive outcome from transgressing them. Should we ask why G‑d implanted in us the ability to become so strongly attached to another person that it might compel us to defy Him, the answer is: in order to reward us commensurately for overcoming this challenge; we can be assured that G‑d can be relied upon to reward us amply when we comply with His will.1