In Vayikra Rabbah 32:5 the Midrash Rabbah is explicit that one of the reasons the Jews were redeemed from exile is because the did not speak Lashon Harah (slander) about each other while they were in exile.
ולא אמרו לשון הרע, שנאמר (שמות יא:ב): דבר נא באזני העם, אתה מוצא שהיה הדבר מופקד אצלן כל שנים עשר חדש ולא הלשין אחד על חבירו.
"And they did not speak Lashon Harah, as the verse states (Shemos 11:2) "speak please in the ears of the people." We find that the matter was entrusted to them for twelve months and none of them slandered their fellow.
(see full context there)
However, in Shemos Rabbah 1:30 the Midrash Rabbah is explicit that the reason the Jews were enslaved in Egypt was because they were speaking Lashon Harah.
ורבותינו בשם רבי אלכסנדרי אמרו, היה משה מהרהר בלבו ואומר מה חטאו ישראל שנשתעבדו מכל האמות, כיון ששמע דבריו אמר לשון הרע יש ביניהן היאך יהיו ראויין לגאלה, לכך אמר: אכן נודע הדבר, עתה ידעתי באיזה דבר הם משתעבדים.
"And our masters said in the name of Rebbi Alexandri, Moshe was thinking in his heart and saying, what sin did the Jews do that made them deserve to be enslaved more than any other nation? Once he heard this man's words he said, there is slander among them, how can they be fit to be redeemed? Therefore he said 'now the matter is known', now I know why they are enslaved."
What was it? Does the Midrash Rabbah learn that they were slandering each other the whole time and that was why they were being enslaved or does the Midrash Rabbah understand that they were not slandering each other at all and that was how they merited to be redeemed?