Your code makes him move vertical and horizontal if needed.
He moves the same speed both vertical and horizontal, that's why you only get a 45 degree angle.
He moves like this until there is no need to move vertical, and he only moves horizontal the last bit.
To solve this you need first to calculate deltaX = enemy.x - playerX and deltaY between the two points, and move the portion of distance in each direction, and he will move directly from A to B.
You'll need to know the distance to set constant speed. Find it with theDistance = Math.sqrt(dX*dX+dY*dY) with the squareroot-method.
I suggest unifying the direction by dividing deltaX/theDistance over the distance to get your direction, then you can just multiply this with the speed you want on the enemy.