IMO the causality can be all messed up! The attitude in scifi often reflects the current cultural ethos. When the outlook was more optimistic about the future in the 50s and 60s, so were the books. Starting in 80s / 90s society became weary of tech, so did the writers!
I actually worked on the data scraping and analysis for this piece, we tried to quantify how dystopian or utopian the most popular scifi books were over time.