Rabeinu yonah in Shaarei Teshuvah 3:9 writes:
אמרו רבותינו זכרונם לברכה ישב ולא עבר עבירה נותנין לו שכר כעושה מצוה
כגון שבא דבר עבירה לידו וניצול ממנו... גם השכר הזה עקרו ויסודו מצות
עשה שכבש יצרו ביראת אלהים
Our sages said "If someone sits and does not commit an aveira he is
rewarded as in doing a mitzvah". This is when the situation of aveira
comes to him and he saves himself from doing it. This reward is
based and founded in the fact that he conquered his evil inclination
due to the fear of Hashem...
Rashi on the Gemara Kedushin 39b also explains it to mean:
ישב ולא עבר עבירה דקאמר נוטל עליה שכר בעבירה שבא לידו וכפה יצרו ולא
עבר
He is rewarded for an aveira which came to him and he conquered his
yetzer [harah] and did not transgress.
We see from this that reward for refraining from an aveira is only when there is a conquering of the Yetzer Harah (evil inclination).
Therefore, when someone refrains from doing an act which he / she is not forbidden to do, This concept of overcoming the yetzer harah does not exist, and thus there is no reward.