Rabbi Joshua of Sikhnin said in the name of Rabbi Levi: By the merit of two things Israel makes itself beloved before the Omnipresent—by the merit of the Sabbath and by the merit of tithes. By the merit of the Sabbath, as it is written, "If you turn back your foot from the Sabbath..." (Isaiah 58:13). And what is written after it? "Then you shall delight yourself in the LORD..." (Isaiah 58:14). And by the merit of tithes, as it is written, "And you shall rejoice in all the good" (Deuteronomy 26:11)—and "good" means nothing other than Torah, as it is written, "For I have given you good instruction; do not forsake my Torah" (Proverbs 4:2). Therefore Moses warned Israel, "You shall surely tithe" (Deuteronomy 14:22).
Why Israel Finds Favor Through Sabbath and Tithes
Midrash Tanchuma Buber, Re'eh 8:2
ר' יהושע דסכנין בשם ר' לוי אמר בזכות שני דברים ישראל מתחטאים לפני המקום, בזכות שבת, ובזכות מעשרות, בזכות שבת דכתיב אם תשיב משבת רגלך וגו' (ישעיה נח יג), מה כתיב בתריה, אז תתענג על ה' וגו' (שם שם יד), ובזכות מעשרות דכתיב ושמחת בכל הטוב (דברים כו יא), ואין טוב אלא תורה, דכתיב כי לקח טוב נתתי לכם (משלי ד ב), לפיכך משה מזהיר את ישראל עשר תעשר].