Verse 22 said that the Meraglim will keep Rachav alive. Why does it say here that Yehoshua kept her alive, because she hid the Meraglim?
Malbim: Refer to 6:22:1:1.
Megilah 14b expounds that she converted and Yehoshua married her. "V'Lo Sischaten Bam" (Devarim 7:3) forbids marrying one of the seven Kena'ani nations after conversion!
Radak, Tosfos (14b): She was from a different nation, and came [with her family] to live in Eretz Kena'an. 1
Tosfos ha'Rosh (14b, citing the She'altos): Some say that the Isur "v'Lo Sischaten" applied only after they entered the land. 2 Rosh Yosef (14b)
Pesach Einayim (14b): The Sifri (Beha'aloscha) says that she was from the [seven] nations, about whom it says "Lo Sechayeh Kol Neshamah"!
Tosfos (14b): This is wrong. A Midrash (cited in Rashi Devarim 29:10) says that Nesinim came to convert in the days of Moshe, just like in the days of Yehoshua, and even so, they were not permitted to [marry into] Kehal Yisrael. Rather, they were made to be wood choppers and water drawers. (What is difficult? Yevamos 79a says that Moshe decreed for his generation. This implies that the Torah permitted them! Perhaps Tosfos holds that Moshe decreed slavery on them (see Tosfos Yevamos 79a); the Torah already forbade intermarriage , but in any case