This seems so obvious it hadn’t previously occurred to me to write it. I spoke to a friend about it recently and they said, “oh wow, that’s a really good management philosophy,” or something similarly flattering and to the same effect. Maybe it is not as widely accepted as I believe it should be.
It’s ok when people leave your team or company at work. Be happy: they’re graduating! One of your jobs as a “leader” (manager, tech lead, principal) is to facilitate the growth of the people you work with. (Pro-tip: this is also a good thing to do as a peer). If they then pursue another role they want, that’s good!
From the other side, no, I don’t think it’s a good idea to job hop every 6 months as a means of career advancement (though it is always ok to leave an abusive relationship). Doing so would not give you the experience of living with the consequences of your technical or managerial decisions. Seeing a thing done and deciding to do a thing are separated by a volitional gap that I didn’t appreciate until I was in the decision-making position. But not-job-hopping-as-a-career-strategy is a different constraint to being bound to a role, team, or employer. You should not feel guilty over leaving a job.
People can leave. If no-one ever leaves your team, that seems like it might be bad, actually. Try to actively nurture.