Svargalok is considered as a place where good people reside. From the wiki -
Svarga is seen as a transitory place for righteous souls who have performed good deeds in their lives.
However, many stories/references on Indra's character do not support him to be king of swarga, e.g.,
- Indra seduced Ahalya
- He once stood against lord Krishna(Govardhana Parvat incident)
- Always in doubt for his throne
- He struck Hanuman's jaw during his childhood
Do not forget serials by Ramanand Sagar
Then what makes him the king of demi gods despite of having such loose character in various incidents.