A Longsword is equivalent to a spear and nothing gained from the feat works only with Longswords; there are no balance issues
We can see that Polearm Master applies to Spears naturally, so what a character does is answer the following question: Do they want to use Polearm Master with a Spear or a Longsword? The bonus action attack will do the same damage, they have the same range, and are both versatile; the only thing worth considering is that Longswords deal +1 average damage and Spears are throwable (note that it's actually less than +1 damage because of your chance to hit).
In terms of the feat, there are no benefits unique to the Longsword; any reason to use a Longsword with this feat is also a reason to use a Spear with this feat. If the feat made you roll additional damage dice then these would be different, but it doesn't; there is nothing being added only to the Longsword.
This trade-off of the Thrown property for more damage is an established metric of balancing weapons; this can be seen as it it is the only differences between a Scimitar and a Dagger, a Flail and a Javelin, a Trident and a Warhammer, and a Battleaxe and a Spear. This trend shows us that a weapon losing the thrown property can be balanced out by increasing its die size once. Thus the Longsword is equivalent to the Spear in terms of how the weapons table itself is balanced; as a result, this would not disrupt weapon selection balance.
Choosing not to use a Spear is still a significant decision because you have removed the ability to fight well against anything not immediately adjacent to you.
How bad/good is the Longsword's +1 damage over the Spear?
Let's say our character has a 50% chance to hit and makes four attacks per turn as well as the opportunity attack at some point. This is a generous assumption of our combatant as the number of attacks their making is basically only doable by a Fighter though they are quite likely to be able to make the opportunity attack, given what the feat does.
This would be an average +.55 damage five different times for a total change of +2.75 damage over the spear per round. This is honestly a very small change in overall damage and isn't going to be something that will suddenly ruin the balancing and flow of your game. I really don't think a generously high +3 damage over the course of an entire round is going to ruin your game. The combatant is choosing this bonus to damage over the ability to throw their weapon well.
As pointed out, a Fighter would more likely have a 75% chance of hitting, in which case their damage difference go from +2.75 to +4.0. Note that at this level there are spells like meteor swarm dealing 122.5 damage to every creature in a 40-foot radius. Though that is one per long rest, whereas this change is every round. Honestly, the fourth attack only occurs at level 20, when much of balance has gone out a window.
Let's say our Fighter makes only three attacks per turn with a 75% chance of hitting. Then they get an average increase of +3.2 damage per round, which is not much higher than +2.75. I can't see 16 additional damage over the course of a five-round combat having an especially alarming impact on your game. It's certainly nothing to scoff at, but 4.0 of the damage comes from opportunity attacks the enemies can try to work around. I can't see 3 points of health each round dramatically shifting the playstyles or outcomes of battles.
If our combatant made a more reasonable two attacks and an opportunity attack per round, their change in damage per round is brought down to a mere +1.65 which I can't see having any meaningful impact on table play and experience.