D&D 5e was my first tabletop game and I was disappointed to see how little does the alignment influence the game, since I am a big fan of the Good-Evil, Order-Chaos axes. In which editions does alignment have an important role?
RAW, Alignment was a major impact on roleplaying and character rules all the way to 3.5
The past editions of D&D were strict about alignment, and some of the earlier editions were very strict about much more. In 2nd edition, your attribute scores and even your race allowed or prevented you from playing certain classes. (Imagine a time where dwarves could only be Fighters, Clerics, or Thieves!)
3rd and 3.5 editions removed several of these restrictions, but Alignment was still a very crucial role. Some classes in their descriptions in the Player's Handbook required certain alignments to be allowed to play them. Barbarians could only be Chaotic. Most Divine spellcasters had to be some form of lawful. Paladins were the toughest, they were only allowed Lawful Good. For a character to worship a deity, they had to remain one step of separation from the Deity's alignment (If the God was Lawful Good, the character could be Lawful Neutral, Lawful Good, or Neutral Good, for example.)
The consequences of not roleplaying to a declared alignment were real. It also listed in their descriptions in the 3rd and 3.5 PHBs that if the characters acted in a way that would permanently shift their alignment away from these restrictions, they lost their abilities.
There was even a spell, 'Atonement', which was a spell designed purely for characters that had strayed, and sought to regain the powers of their class.
This is all considering if you had a group that wanted to play this strictly, which thankfully no one I knew would. This is where you get stories of paladins not playing well with even morally grey-area characters. They had to be the beacon of light and good, or risk their x-level Paladin become a x-level fighter but with fewer feats.
It was 4th Edition where you saw the relative omission of Alignment and the past requirements. In 5th edition as you have seen, it's more of a description than a requirement.
In my practical play experience? None of them. Alignments are somewhat more mechanized in the earlier versions of D&D, but it would be misleading to say that they "played a big part". "1st Edition" AD&D has XP loss for changing alignment, and there are some spells and items that help/harm certain alignments but all of those effects are either "rare" or "trivial".
- There's seldom a reason for a character to change alignments - this is D&D after all, not a game of big moral quandaries - so the XP penalty for changing alignments mostly only crops up if a GM decides the player is "playing wrong" and decides to punish them for it.
- The items that react to alignment are super rare, usually powerful stuff. As exciting as it is to read about intelligent swords and Books of Exalted Deeds, if you're seeing a lot of this stuff in play, you're playing a pretty weird version of D&D. The semi-exception to this was Helm of Opposite Alignment, which goes into the earlier category of "GM jerk moves"
- The spells that referenced alignment are much more common than the items, but mostly weren't worth spending a precious spell slot on. The best effect of Protection from Evil was actually alignment agnostic, in that it protected you from summoned creatures far more effectively than it protected you from evil ones. And even then, it was a questionable use of a precious spell slot unless you KNEW you were looking at facing some summoned creatures, otherwise you risked using a slot on a spell that would do nothing for you. Detect Evil, likewise, was pretty much rubbish - it didn't detect creatures of an evil alignment, just "emanations of evil," whatever those are.
- There were also alignment restrictions on some classes. These were mostly irrelevant too, except for the Paladin, which had, if memory serves, extra stringent requirements (and was virtually impossible to play without cheating back in 1e AD&D anyone due to the ability score requirements.) The rest of the class alignment requirements were window dressing where you wrote something on a line on your character sheet and then ignored it, thereby satisfying the "requirement".
Alignment has generally been less relevant as the game has gone on - 2nd Edition AD&D didn't make any particularly relevant changes that I can recall, and by the time we got to 4th edition they introduced "Unaligned" as an option for people who wanted to opt out of the whole system.
Unless your GM really wanted Alignment to be a front and center concept, it has never been an "important part" of D&D. I have played lots of games of D&D from Mentzer Basic through AD&D1, 2, 3rd edition, 3.5, 4, and 5, and I have never had the experience that Alignment was more than just a descriptive line on the character sheet. Fundamentally, it's almost impossible to make it have teeth, because it comes down to judging people's behavior and then maybe punishing them for it.
I think the alignment system integral to the game, just not to how a player must be played. In all the versions (I have never played 4e but played all the others) monsters are all given alignments and pretty much always play to type. There are exceptions, but are note worthy because they are exceptions. Most NPCs follow their alignment religiously, the whole point in giving them alignment was as an aid for how to role play the characters.
I think PCs have alignment for the same reason, they help guide players decisions but a character should be way more flushed out than a monster or NPC. They are fully developed characters with complex motivation and back story that can't really be captured by a single value. Also a fundamental tenant of most role-playing games is the player can do anything they want, a game that enforced a rigid moral code would be antithetical to this basic tenant. A player can take on such a good and should be rewarded for good role-playing if they follow it but it would be hard to imagine how the game would enforce it.
The typical D&D printed module doesn't have a lot of complex moral choices, the monsters or NPCs are mostly evil and the characters are mostly good. All the murder and theft the characters pull off are justified by this paradigm.
Any roleplaying game can be a good framework to explore moral decisions but really a game without fantasy monsters and evil and good races allow for more nuanced decision making. It is OK to murder a village of Orcs down to the women and children because all Orcs are evil.
I just finished reading the Orc King which is a forgotten realm based book with a good drow (Drizzt) and an Orc king trying to make peace with the dwarves. There is nothing to prevent this kind of story telling in D&D but nothing really to encourage it either. You can make an adventure in which every challenge you face includes a moral delima but it would be a lot of work to build and maintain that kind of tension.