(Numbers 3:15:) ENROLL THE CHILDREN OF LEVI. This is what Scripture says (in Psalms 68:7 [6]): GOD SETTLES THE SOLITARY IN A HOME. A certain matron asked Rabbi Yose ben Halafta: In how many days did the Holy One, blessed be He, create the world? He said to her: In six days, as it is said (in Exodus 31:17): FOR IN SIX DAYS THE LORD MADE <the heavens and the earth>. She said to him: And from the time the world was created, what does He do? He sits and pairs couples together, and decrees decrees, and says: So-and-so shall marry so-and-so; as it is said (in Psalms 68:7 [6]): GOD SETTLES THE SOLITARY IN A HOME. Who was this? This was Amram and Jochebed his wife, for through their merit the Holy One, blessed be He, brought Israel out of Egypt, where they had been enslaved with clay and with bricks. What did the Holy One, blessed be He, do? He paired Jochebed with Amram, in order to raise up from them a redeemer for Israel, and to raise up from them high priests. Therefore it is said: GOD SETTLES THE SOLITARY IN A HOME. The Holy One, blessed be He, said: Since this tribe is accustomed to raising up redeemers, go and count them. ENROLL THE CHILDREN OF LEVI.
Why God Counted the Tribe of Levi, Raisers of Redeemers
Midrash Tanchuma Buber, Bamidbar 18:1
פקוד את בני לוי. זש"ה אלהים מושיב יחידים ביתה (תהלים סח ז), שאלה מטרונא אחת את ר' יוסי בן חלפתא לכמה ימים ברא הקב"ה את העולם, אמר לה לששת ימים, שנאמר כי ששת ימים עשה ה' (שמות לא יז), אמרה לו ומשנברא העולם מה הוא עושה, יושב ומזווג זיווגים, וגוזר גזירות, ואומר פלוני ישא פלונית, שנאמר אלהים מושיב יחידים ביתה, מי היה זה, זה עמרם ויוכבד אשתו, שבזכותם הוציא הקב"ה את ישראל ממצרים, שהיו משועבדים בטיט ובלבנים, מה עשה הקב"ה, זיווג את יוכבד לעמרם, כדי להעמיד מהם גואל לישראל, ולהעמיד מהם כהנים גדולים, לכך נאמר אלהים מושיב יחידים ביתה, אמר הקב"ה הואיל והשבט הזה למוד הוא להיות מעמידים גואלים, לך וספור אותם פקוד את בני לוי.