In “If I Forget Thee, O Earth,” we are never explicitly told why this is Marvin’s first time to go outside. All we are told is that he had never been “Outside” and that, when the airlock doors open, he sees the “land which he had never yet entered.” We can only speculate, then, about why Marvin has never been outside.
I believe that Clarke includes this detail about Marvin because he wants to emphasize for us how cramped and unpleasant life on the moon is compared to the life we have on Earth today. He wants us to feel how much the people in the colony on the moon are suffering due to the bad decisions made by the people on Earth. By saying that Marvin has never been outside, he shows us that these people live very artificial, unnatural lives that would not be much fun for those of us who have known more freedom in our lives.
If, however, you are asking why the adults in the story have never let Marvin outside before, the answer will be different. We can infer that people only go outside for important things. There does not seem to be anything to do outside for recreation, so there is no reason to go outside unless you have work to do. As a 10 year-old, Marvin is clearly not going outside to work, so there will have been no reason for him to go.
So, we can answer this in two ways. We can say that Marvin has never been outside because Outside is inhospitable and people only go there for important reasons. Second, we can say that Clarke has this be part of the story so as to emphasize to us the consequences of destroying our planet through nuclear war.