Sometimes, identities are something that we choose- the article is focused on people choosing a psychiatric diagnosis as an identity but there are a lot of other identities people choose, based on their work, hobbies, where they live, etc.
For example, I am a programmer. It’s an identity I have, based on both my work and hobbies. It’s a useful shorthand for me to share some information about myself and find other likeminded people.
People don’t always choose their identities either. A lot of people have an identity imposed on them. When society creates an identity around something that applies to you, it might be impossible to avoid it even if you want to, and embracing it may be a necessary survival strategy.
I don’t think it’s a matter of desperation that people cling to them. In some cases it’s a matter of pride, people want a way to claim their membership in a group and show their values and things they care about. I think we all do it, but some people are aware of it or do it intentionally more than others. In other cases, like I said, it’s not a choice. People may desperately want to not have a label imposed on them but they can do little to avoid it.