In S5A10, after learning about Rick's life, I would feel that after losing his wife and daughter and seeking revenge in vain, Rick escaped into a nihilistic situation. He only has one wish, which is to lock up Rick who may harm others across parallel universes. To this end, he assisted in the construction of Rick city and created the central finite curve. After this, everything is meaningless, because the revenge that drives The Rickest Rick (hereinafter referred to as RR) has been extinguished. Rick City is not so much a place where the brightest ricks live, but rather a place where RR imprisons other ricks. So within the central finite curve, Rick has the motivation and reason to live, which is to substantially supervise Rick City and prevent them from running into other parallel universes and harming other Ricks.
As for why he chose to live with the Beth family, it was because it was the only family he had, and RR has always been a family-oriented person. In Summer and Morty, he loves both, but because of the Morty black market production and trade secretly carried out by Rick City, he has a stronger sense of guilt towards Morty, so he prefers to get along with Morty.
In the end, Evil Morty (EM for short) successfully destroyed the central finite curve and got rid of the shackles of RR, while RR also got rid of the shackles of itself. EM has said that it is impossible for RR to escape from its past. He really can't get rid of his past, which is why he forged his past into Rick City and the Central Finite Curve. This is the monument and cage that Rick made for himself. However, both of these existences were destroyed in the process of EM's struggle for freedom, which means that he destroyed RR's self-made cage at the same time, and also gave RR freedom.
At the end of the episode, RR looked at the empty teleporter gun and threw it on the console; EM took out the teleporter gun and opened his own portal.
They all got their own liberation.
View more about Mort Dinner Rick Andre reviews