I was level 21 and earned 50000 points and gained next level. Still the new level is 21 and I need to earn now 75000 points. What went wrong?
Most likely you were actually level 20 since level 21 requires 50k XP and level 22 requires 75k XP. You can find websites for all the levels and XP requirements, Serebii for example.
It sounds like you leveled up while your internet connection was sketchy and you dropped a transactional packet. Sorry, man, the game giveth and the Internet taketh away. Niantic programmers were never very good at transactional programming as evidenced by the frequent loss of candies when sending excess Pokémon to the evil Professor and other instances of the big red ERROR box that you are undoubtedly familiar with. Try to level up with a seriously good Internet connection in the future. But I must say that you are lucky to learn these lessons at level 20 rather than level 33 where they entail a million experience points.