It's not mind control - even charm person is not mind control - it's a magical influence, and friends is a very mild magical influence - it doesn't make them obey you, it just temporarily alters their perception of you, to consider you a friendly acquaintance (not even a close friend), and you don't neglect your duties and important objectives just because a friend you know asked you to. It's a very mild spell, which is why it's a cantrip - it doesn't achieve anything that you couldn't achieve with normal conversation, it just makes doing so easier and faster, at the cost of a lingering hostility and resentment from the individual afterwards.
Crown of madness, compulsion, dominate person, command and even suggestion - these are examples of actual mind control spells that compel your target to act in specific ways, or let you dictate what they do and how they behave. Charm Person, and Friends, are not this.
Consider this spell from the point of view of the victim. Someone comes up to a medieval villager and uses magic to alter their mind to get them to agree to something they didn't want to agree with. That's mind control from their point of view. Casting mind influencing spells against someone without their knowledge or consent is an attack against that person.
There is also a misunderstanding about 'Hostile', and that is the crux of the problem here.
Hostile does not mean 'will attack you' or 'get a red border and is now an enemy'; that's not what it means and it's not what it's ever meant within 5e nomenclature. Hostile is a dispositional state - a hostile NPC is inclined to mistrust you or your intentions, and is not inclined to help you, and may be difficult or even potentially impossible to convince to assist you or to let you do as you wish. That is what it means; nothing more than that.
Perhaps you should read the spell.
Friends
For the duration, you have advantage on all Charisma checks directed at one creature of your choice that isn't hostile toward you. When the spell ends, the creature realizes that you used magic to influence its mood and becomes hostile toward you. A creature prone to violence might attack you. Another creature might seek retribution in other ways (at the DM's discretion), depending on the nature of your interaction with it.
It literally says in the 5e spell description that one of the possible outcomes of the spell is that the victim might attack you.
Having NPCs attack you for using the spell and by extension turning whole factions against you, is absolutely not correct interpretation of this cantrip spell.
As noted above this is exactly the correct interpretation of the spell. "
That stinking spell caster just mind controlled me! Get them!"
(This is also a Baldur's Gate tradition. In the original Baldur's Gate if you failed vs pickpocket against a sleeping person in the Friendly Arm Inn he would go red and still be sleeping. Even if the door was closed and no one could have possibly seen the failed thievery attempt the entire Friendly Arm Inn went red and would attack you.)