A few reasons: The amount of fissile materials on Earth isn't infinite. As far as I understand (please correct me if I'm wrong... this is not my professional background), there are only ~230 years of uranium available.[1] And that's at today's consumption rates; build the amount of reactors we need and it's even less. Maybe we'd find more or maybe there's some other fissile material to use (thorium?). I'm not knowledgeable enough about the specifics to be honest, but it is finite on some timeline. Whereas wind and solar will last as long as the sun lasts.
Aside from that, there's always the small risk of malfunctions and nuclear proliferation. Even with newer tech that could greatly limit the possibility of accidents to near zero (it's already absurdly low) there's still the constant need of water for cooling and geopolitical issues causing problems like what is happening right now with the Zaporizhzhia plant in Ukraine.
That's why I say it's not perfect but that it does serve an incredibly important purpose in the near term to dramatically lower CO2 emissions and buy time to either deploy more wind & solar, extend the life of nuclear, or maybe deploy fusion if we ever finally crack that egg. Exactly how that looks would likely be a question for our children to answer.
[1] https://www.scientificamerican.com/article/how-long-will-glo...