Safeguarding oneself in matters of kedusha is great for parnassa. This is depicted in the following. There were two great people that have in their appellation the word Tzadik. One is Noach and the other is Yosef, who is known as Yosef Hatzadik. Both of them lived in a generation that was promiscuous and each overcame the challenges — Noach in the generation that brought the Mabul and Yosef who overcame the test with Potifar’s wife in the promiscuous country of Mitzrayim. We also know that both Noach and Yosef also were the single providers for everyone’s sustenance. In the teiva, Noach provided food to the people and the animals while Yosef was the provider in Mitzrayim.
So they each stood against immorality and they were the distributors of food to the world.
A hint to this is found where it speaks of parnassa: The words פותח את ידך ומשביע לכל חי רצון, You open Your hand and satisfy the desire of every living thing is followed by the word צדיק. This is hinting to us that in the merit of the Tzadik Hashem brings parnassa.
