The game already basically does that, since you do get confronted for killing and stealing, and in most cases if you're caught killing especially, it seems like you may just outright aggro everyone in the surrounding area. So there needs to be polish on the system, but the system is certainly there.
Well that is good to know.
Not only must there be alignment, it must also result in appropriate rewards and punishments in-game. For example, if a society is defined as being generally good and especially lawful, where stealing is considered a crime, then if in-game a player resorts to stealing from people in town and they get caught doing it, or even just bring suspicion upon themselves, there ought to be in-game negative consequences. I utterly disagree with and reject the notion that this amounts to "punishing a player for playing the game their way." Same thing if you have gained a reputation as someone who slaughters people for your material benefit or just for the fun of it. The excuse that 'I want to play the game my way' should not be allowed to dictate the game responding appropriately to such behavior by the player based on the values of the society within which the game is set.
I want to invite you to consider that You are conflating Alignment and reputation. Alignment is an internal barometer of worldview that determines your ultimate place in the wheel cosmology after death. It can reflect in your actions and it can also change with experiences.
There has been a bad trend (Pathfinder) of making actions reflect on changes in alignment, like its some sort of constantly updated actual moral Barometer. It also broadcasts that alignment which is another bad take.
5E - thankfully - has taken the opposite tack - Alignment is not broadcast and its just an internal point of view that can change with experiences and exposure to different things - less actions you take and more based on experiences.
Reputation is a totally separate mechanic that should work as you describe. However, a Chaotic, Neutral or Lawful Evil person can have a good reputation - especially if it suits their needs in the long or short term.
Yes I generally agree with you on this. But ...
A person's reputation is determined by their behavior, which in turn may or may not be determined by their alignment. However, if a player is truely and honestly roleplaying their character based on their character's alignment, AND alignment has been accurately defined within the game's mechanics, then alignment SHOULD reflect behavior.
I don't disagree with this, but..let me give you an example of how Bg1 and 2 screwed this up badly.
In Bg1 and 2 if you had evil party members they would EXPECT you to have a bad reputations. If you failed to maintain at least a Neutral or Lower reputation they would leave.
Having a Neutral or Lower reputation would affect your ability to but and sell goods, what prices you would get, and if you had a low enough reputation the guards would chase you and you couldn't really buy or sell, or interact with anyone in town.
None of this makes any sense. Just because a player is NE - doesn't mean they don't want to have a good reputation and be able to go to town and enjoy creature comforts. In fact, a lot of their behavior is around the idea of personal wealth and comfort which you can't have if you are hated. It made no sense, compounded by the fact that Sarevok, who was Chaotic Evil, had a really GOOD reputation for the majority of the game.
Also I am against being able to actually SEE a persons alignment. It takes the fun out of trying to get to know a person.