@Deuteronomy’s comment on this question made me wonder what caused the reemergence of idolatry after the flood.
From Enosh to Noah, there were generations of idolaters. Noah believed in God, and presumably his sons did as well.
Rambam in MT Avodat Kochavim 1:1 explains the emergence of idolatry in the generation of Enosh. However he does not mention the flood in that context. Nor does he mention the four seemingly pious couples that remained afterwards (Noah, his wife, his three sons, and their wives).
IIRC, after the flood the sons of Noah parted in different directions. Each begot sizable descent, and eventually, we end up with Shem's line full of idol-worshipers. We are also told by the interpreters that Shem and Ever ended up in Israel learning Torah.
Who reinstated idolatry and how? What was the idea behind it after the flood, when Noah (and his righteous sons) were still alive?