Why is active transport needed in repolarization?
...when the movement of ions is not against their concentration gradient...


This assumption is incorrect: Na+ has to be pumped out of the cell against its chemical gradient (table 1) and against its electrical gradient, given that the inside of the cell is negative (Fig. 1).


  ...potassium ions have diffused out in repolarization, only the sodium ions are left in the intracellular space


This is incorrect: There are heaps of K+ ions in the cell, also after repolarization. A tiny fraction exits the cell during repolarization.


  ...moving out of the cell where there are no sodium ions...


This is incorrect; there are Na+ ions out of the cell, heaps in fact. You should be aware that the flux of ions is not an all-or-nothing phenomenon. It is a flux of relatively few ions out of a pool of them. Action potential formation and ion gradients are membrane-bound phenomena. While Na+ may enter the cell during an action potential, there is still a nearly infinite large amount of Na+ left in the intercellular space.


Table 1. approximate ion concentrations in and out of the cell. source: Med Quarterly  


Fig. 1. Action potential. source: UC Davis