The other answer is correct, but is not sufficient for this particular episode. It's true that Rick cannot infinitely jump dimensions. However, in this episode, he reveals that it was his (backup) plan to do exactly that.
Rick is willing and capable of jumping dimensions in this episode, which he explicitly confirms. So why doesn't he?
The answer is Morty.
Our Rick is already known to be uncharacteristically emotionally attached to his Morty (more so than any other Morty, based on how he reacts when he encounters other Morties).
Seems like too much effort to put into one reality for Rick considering that he can just hop to another one and has done so at least once before.
Rick is perfectly capable of doing so. Again, he explicitly confirms that this was his plan.
It's never explicitly confirmed whether he regrets having to leave the current dimension. The fact that he stays and gets schwifty suggests that part of him wants to stay here.
However, he must have at least accepted that it may be unavoidable to have to jump dimensions (if Earth is not capable of winning the contest, Earth will be destroyed).
The whole plot doesn't make sense to me at that point. Why wouldn't they just leave from the get go?
Rick is capable of jumping dimension and continuing with his life as if nothing happened. But Morty isn't capable of that. Morty cares, Morty wants to save people (like Fart). Morty cannot deal with the bleak "whoops, better jump dimension!" attitude that Rick flaunts.
Even in Cronenberg world, Morty wanted Rick to try and fix it, before he accepted that things were unfixable. And even after they have tried everything, Morty still suffers from the emotional fallout of having to assume another Morty's identity.
Rick tries to save Earth because Morty wouldn't follow him to a new dimension otherwise.
This is pretty much proven by the events. The exact moment where Rick reveals that he was planning to leave the dimension (at least as a backup plan), Morty immediately takes offense.
To Morty, this proves that Rick is probably not trying his best to save this particular dimension, a dimension that has now become Morty's home.
And as a punishment, Morty portals out. This is a double punishment for Rick, though Morty doesn't understand that:
- Morty is aware that Rick no longer has his portal gun (since Morty took it), and Rick must therefore really try to save Earth if Rick wants to survive.
- Morty is not aware that Rick was trying to save Earth for Morty, and that he likely wouldn't want to jump dimension without Morty anyway. This is somewhat proven by Rick sacrificing himself for Morty in S02E01, even though he could've just jumped to a dimension where Morty still lives. This Rick cares about this Morty.
Edit - A small thing I forgot to mention.
Rick could simply have forced Morty to jump dimension with him. However, this would negatively affect his relationship with Morty, who will always resent him for doing so (and Morty may not even be able to emotionally handle being forced to jump dimension).