Yes, this is expected behavior.
MobileConnect and the Contacts you have in there have a special attribute related to Mobile Numbers called Priority.
What it essentially means is that there can be only 1 Contact that has specific Mobile Number as Priority 1 number. Every other Contact with this number is with a lower priority.
Generally the latest Contact added to MobileConnect will gain the Priority 1 status, unless you have manually specified it to be different.
The purpose is simple - personalization. Meaning the Contact that has this number as Priority 1 number will be used as the basis for all the MobileConnect personalization strings. It makes sense because one mobile number can realistically exist only once and belong to just one person, thus, the person who was added the latest, will be used as the basis as it is assumed this person is being targeted.
Another reason for it to work this way is pre-paid SIM cards, these numbers are recycled over and over, and you really wouldn't want to send SMS to new owner about some critical or sensitive information about the previous owner.
This also means if this number is Opted-Out from a specific Keyword, it will apply to all other Contacts having this number. Keyword status is not related to the Contact, but to the Mobile Number.
Another thing to know is that contacts can have more than 1 Mobile Number on their record, each with their own Keyword subscription status, but only the Primary number is going to be used when SMS is sent out via Marketing Cloud.
You can read more about these topics on the following links: