Just a couple of thoughts on what people have said.
1. People tend to treat the Foundation Trilogy as a set of novels; its not. It is really a collection of short fiction (from short story to novella length). In science fiction its generally difficult to focus much on characters and still make it an SF story in short fiction. While he was never a great character writer, the characters in his true novels do tend to have a bit more depth to them. Maybe not three dimensional, but maybe 2.5 dimensional

.
2. Dune, published more than 2 decades after foundation escapes some of the datedness of Foundation by essentially throwing out any technology we recognize. Computers are banned, atomics likewise by strong social conventions. Lots of other normal technology is explained away by a single revolutionary (and implausible I might add) technology. Spice is a gigantic McGuffin. It all works. Dune is truly one of great SF books of all time and remains readable today without seeming overly dated. Dune Messiah was pretty good as well. Frankly, though I read them, I think the rest of the series was average at best.
3. On Heinlein. I think he was truly visionary in the early years and for me, remained highly readable up through the mid-60s. After that, the weirdness first displayed in Stranger in a Strange Land seems to become the norm.
So, is any of it great literature? I don't know. I expect that judgment will be made in about 50 years. Some that are held up as great now will likely be mostly forgotten and others denigrated might be considered new classics.
--
Bill