Of course it's a valid reason. In fact, it's an excellent reason. I know exactly how this feels: you are interested, enthusiastic, willing to learn, full of life energy. You care for things, and you want to solve problems even though they might not be in your job description. On the other hand, your environment is full of people who don't care. They are not there to solve problems, but to sell their time, to keep the chairs warm, to participate in meetings that will justify their salaries. They need to be told what to do, and they will only do what they are told. Their motto is "the more complicated, the better".
Any future employer who understands this will wellcome you with open hands. He will know that people like you are rare and valuable like a treasure. They will know that people like you are an asset to a company, the future Elon Musks and Jeff Bezos, whereas the other people are a liability, like furniture and machines. Almost every job advertisement out there says that they are looking for "highly motivated people". That's you.
And this is what is so wrong with our society. Everybody lies, everybody pretends. People work in jobs they hate and we have learned and accepted that this is somehow how it is supposed to be. It is not. I'm surprised and disappointed at how many people are advising you to shut up, to be like others, fit in the box. I'm willing to bet that many of them hate their jobs.
One thing is true though - citing others as the reason for you leaving slightly misses the point. So instead of "I left because my colleagues were unmotivated" it could be better to say "I left because I couldn't realize my full potential".