Ideas are usually not worth very much, all the implementation and figuring out whether an idea works or not is where the effort happens.
In the more general case, academic ethics require that you cite sources for ideas but does not limit the use of ideas. So, if you tell someone about an idea, and they run with it, they should report where their idea came from originally. However, there shouldn't be any limit on who can use the idea: the whole concept behind academic knowledge is furthering the ideas of others. There's also some expectation of developing an idea to a sufficient extent to require credit for it. Something as vague as "what if we could use viruses to cure cancer" isn't really a creditable idea by itself; something like "what if we made the widget less likely to break by using a more flexible material" is a basic engineering concept and not creditable even if no one else has tried using that particular material with that particular widget.
I do think that an advisor has further ethical responsibility (beyond what applies to everyone else in academia) towards the development of their students, though it's hard to make a conclusion about your specific case without a lot more detail.
It's possible the people involved were already working on similar enough stuff that your idea did not add too much: many ideas follow naturally out of previous work.
There also may be some expectation within a lab or research group that there is a constant cycling of ideas: new students benefit from the work that students before them originated, including through contributions to grant funding, and in turn contribute to the cycle of new ideas for the next generation.
Having an idea isn't quite the same as working on one; I would expect a research advisor to "deconflict" work in their group, to not have different people racing towards the same result unless it's openly communicated that this is what is happening and making it a shared project.
Overall, the solution I would recommend among people you trust is clear and open communication. If you are a PhD student and a particular idea is an important part of your thesis, you should be able to share that idea with your thesis advisors without worrying that one of them will scoop you on your project. However, it's still up to you to communicate clearly how that idea relates to your thesis work, just mentioning an idea does not necessarily identify its importance to you. Your primary research advisor should help you with these communications and help you determine when you should and shouldn't share ideas. If you don't trust someone, stop sending them all your ideas.