The Nile River flows north because north is downhill for the topography of the region where the Nile is located. Contrary to popular belief, there is no pull within the earth that causes rivers to flow south. Also contrary to popular belief, cardinal directions are only terms of orientation. They do not indicate topography or elevation.
Though it is believed that north-flowing rivers are oddities, in actuality, the only thing that influences the direction in which rivers flow is gravity. Rivers flow in whichever direction elevation descends. It is not uncommon for rivers to flow north, and many more rivers in addition to the Nile do flow north. The misconception that rivers only flow south is thought to be an indirect consequence of the way in which students learn geography.
Maps are two dimensional depictions of the earth that, when hung on the wall, depict north as up and south as down. Thus, when looking at a map, it visually makes sense that all rivers should flow south. The earth is constantly rotating on its axis. As the earth rotates, every part of the earth cycles through being positioned on the up side of the axis as well as on the down side of the axis. Gravity, however, prevents everything on the down side of the axis from falling from the earth and drifting into space.