Because Indradyumna had been devoted to Vishnu, the god had him born as Gajendra and made him realize that there is something called Kaivalya which is beyond Svarga and Urdhva Loka, the realm of the gods. Indradyumna could attain Moksha finally when he (as Gajendra) left all his pride and doubt and totally surrendered himself to Vishnu.