Firstly, the Ranger proficiencies say "Simple weapons, martial weapons". If you look at the Weapons table, you can see that each category has both melee and ranged weapons in it. The Ranger has every weapon in both categories, regardless of whether it is melee or ranged.
Secondly, the Fighter proficiencies use exactly the same wording as the Ranger proficiencies. "Simple weapons, martial weapons". I don't know where you got "All weapons" from, but the Fighter's and the Ranger's weapon proficiencies are identical.
Finally, if you look at the Weapons table again, you can see that there is no Exotic weapons category in D&D 5e.
The halberd and glaive are there because D&D has a history of offering a wide variety of codified polearms. Namely 2e and previous, which 5e strives to emulate in many regards.
It's fairly likely that someone on the design team, or if not them, someone that someone on the design team talked to, thinks that D&D is not D&D without some variety of polearms to choose from. This could be just "one of those things" (commonly called "sacred cows" in jargon) that becomes a tradition of the franchise and outlives its usefulness by virtue of the fact that many players are familiar with it.
To demonstrate my point, it's easiest to again refer to the 2e Arms and Equipment book, as @nitsua60 did, but also in addition to the core rules. Here's a list of the different polearms codified in the core rules and A&E:
- Glaive
- Halberd
- Lucerne hammer -- like a halberd, but with a hammer.
- Guisarme -- a peasant's weapon specialized in dismounting knights. It's defined by a hook on one side, usually with a spear tip emerging from the hook as well.
- Longspear
- Ranseur -- a spear with a crossguard, like a trident but with unsharpened, shorter side-points.
- Scythe
- Trident
This is pretty exhaustive even considering D&D, and even considering that it's spread over two books. Remember, we're dealing with a subset of two-handed melee weapons. 3rd edition, as most are well aware, did not make any meaningful attempt to curb the amount of codified rules. Pathfinder continues the tradition; a quick glance at the Weapons table in the d20pfsrd confirms that, even going so far as to make the arguably-pointless-in-real-life distinction between the bec de corbin and the lucerne hammer.
In fact, D&D's codification of long weapons goes all the way back to OD&D 1e at latest. Gary Gygax included Appendix T to AD&D 1e Unearthed Arcana (1985) which was an extensive discussion of pole arms that included citation to four different text books about medieval weapons. He ended up including thirteen (that is 13) different varieties of polearms in the original D&D 1st edition Player's Handbook. Even before that, Gygax had provided polearm supplement rules for Chainmail, D&D's wargame predecessor, via the wargame magazine Strategic Review, second issue. Many thanks go to Korvin Starmast for providing the information.
Things like this seem simple and pointless when viewed from an outsider's perspective, but it's just one of those things that gives D&D its character, something that sets it apart from other games, even if it is only a small thing. Many people are sad to see those defining characteristics go.
Best Answer
The difference is in how easy they are to use.
The "Weapon Proficiency" section of the rules says:
Which implies that martial weapons may be more powerful or better able to deliver on a trained warrior's skills, but that simple weapons are more commonly found and easier to use.