Where is the problem? This is only fair. Meele have situations, where they can not attack (monk with practicly zero distance attacks), or have only weak distance attacks. So, it is fair, that they make the most dmg, when they are near the enemy.

Ranger can attack the whole time from each distance, while in motion. So, its fair that they make the lowest dmg of all dd.

Caster are between, because they can attack from all distances. But not the whole time (or can only use weak spells, when they have to move very often). So, it is fair, that they are in the middle.