We Can Improve It
If we could change the pole on one end of the rotating magnet just as soon as it reaches the attracting pole, it could make a complete circle. In doing that, the pole at the near end of the rotating magnet would be repelled by the stationary magnet and pushed away. As soon as the opposite end of the rotating magnet would come into the magnetic field, it would be drawn to the stationary magnet. In order to keep the "motor" running, we would have to constantly change the poles at each end on every half revolution.