This is a result of the classic No True Scotsman fallacy. That’s when someone defines a group as having one set of qualities and thereby denies the existence of everyone who does not correspond to that definition.
So when one Muslim says that another Muslim is not a true Muslim, he or she is engaging in this same logical fallacy. They are essentially defining their own way as genuine Islam and the others as fake. And it is not a purely Islamic issue either. People of every religion and ideology do this. No matter how uniting the influence of a belief system, sooner or later someone starts to point out that some others are “non-Muslims” or “not real Hindus” or “not real Christians”.
This is not surprising however, once you appreciate that people are diverse by nature and that no group of individuals will ever be absolutely same. A person’s individuality often rebels against the labels that are assigned to him or her.