Although there is much more to space than there is earth, it isn't right to simply leave trash in space. In the case of satellites orbiting earth, their orbits eventually decay and bring them back to earth. This is different from things like leaving trash on other space bodies such as the moon or mars. Due to our lack of exploration of extraterrestrial bodies, trash and remnants from past missions can cause confusion in future research missions that may come across the leftover trash. It could also affect the environment on the body if consistently left over time.
The first people on the moon and everyone who came after them should have followed the same rules that every responsible hunter follows. Only take what you are willing to pack out. By leaving trash on the moon they forever altererd the ecosystem and the landscape of the moon for future generations.
I hope that the astronaut just made a mistake and did not intentionally leave litter behind during the moon walk. It would be a terrible continuation of the way we have treated the planet earth, and it sends a terrible message to children who still look up to astronauts as heroes.
No, it is not right for astronauts to leave trash in space because there is no telling where the trash will end up. There is too much we do not know about the universe, and we do not want to regret littering later when new research comes in. We should do our best to maintain a clean environment everywhere.