It always struct me as weird that it is when they leave your reach. To me, you should get an AoO when they leave THEIR reach.
Why? To me, to make an AoO means you are going to attack an opponent that can no longer attack you. So if you have a 10' reach, and they have a 5' reach, you should get your one attack when they move 5' away, since you can all out attack instead of having to also defend against them. If they have a 10' reach weapon, that should keep them safe until they move more than 10' away. That 10' weapon lets them step away and keep you at bay. That means that someone with a polearm can basically disengage for free vs anyone that only has a 5' reach, which also makes sense to me. Two creatures with 5' weapons would still work the same way it does now.
The way it currently is, it makes no sense that you don't get an AoO at 5' when they move away, while the guy with a dagger does. You have to wait til they are at 10', even though you can make normal attacks while they are within 5'.