The reason is moon has some tangential initial velocity, because of that while falling the moon goes away from the straight line of falling to a position where it have to change the direction so it starts rotating around earth. Actually if you can throw the apple with sufficient horizontal velocity it will also rotate around earth (neglecting the air resistance of course).