Ramanujacharya abandoned his wife because she was obstructing his religious practices and spiritual progress.
Ramanujacharya's wife contradicted him multiple times and she created obstacles in religious progress. There were majorly three incidents which made him to do that. Most important one was his wife having a quarrel with his Acharya's wife which made his Acharya leave him suddenly.
On a certain morning, two Sri Vaishnavas came to Ramanujacharya, and did him the service of anointing oil. They asked for some food as they were hungry. He asked his wife if they had some food cooked overnight. She said "No, not so much of a grain of it."; but Ramanujacharya suspected her sincerity bidding her to another business, entered into the kitchen. He found food hidden away. He called his wife and angrily spoke to her thus: "Thou art capable of this, when two hungry souls are waiting at the door, thou liest? Is there worse meanness than, in this wise, refusing food to those who come in dire need? And a lie added to the meanness! Oh!sin!"
On other day, Ramanujacharya was out of morning oblations. His wife and his Guru's wife met at a well for drawing water. An altercation ensued between them as the purity of the pots they held. Purna was observing this from a distance and as soon as his wife returned home, he said to his wife that it's wise to pack up immediately and left to Sri Rangam, after soundlt chastising his wife for unpleasant occurance, of which he held her to be the cause. Ramanujacharya returned home and as usual went to visit his Guru but they were not there. He asked people about the place of sudden absence. They replied "Sire, your lady and your Guru's lady had a quarrel near the well over a pot. The Guru took his wife to task for giving occasion for this, and thinking that if he stayed longer under your roof, her conduct might again give rise to unpleasantness, he considered it expedient to leave that place forthwith." Ramanujacharya was white with rage on hearing this. On recovering, addresses his wife thus :- "Thrice art thou sinner, base woman! My Guru Kachipurna came and took his food under my roof in my absence, and thou lookest the very leaf from which he ate as unholy and polluting. This was thy first guilt. Hungry souls came craving for food. Thou didst deny it and thou didst lie. This was thy second guilt. Now thou hadst had the andacity to pick a most unseemly quarrel with my venerable teacher’s consort. This is thy third and crowning crime. No more art thou fit to remain with rue. Thou art a worldly woman, blind to spiritual interests. Take all this
money, for that ii thy meet share. That is the stuff that well suits a shrew and a scold like thee.’ Well do the SAstras say :—“ Woman is at the bottom of all crime.” They further declare :—“ When house-keeping suits not., enter the monastery” for that. is the true house where strangers and guests
find a ready welcome; but thou hast defiled my roof by thy unworthy conduct offensive to my sense of propriety and decency. It is meet therefore that thou shouldst return to where thou camest from.’ So saying he swiftly despatched her to her parents’ abode.
From The life of Ramanujacharya : the exponent of the Visishtadvaita philosophy by Govindacharya, Alkondaville
Is it righteous deed per dharma?
As I discuss in this answer of mine, the dharma shastras allow to abandon one's wife under some circumstances. One of them is lack of harmony.
From Manu Smriti,
saṃvatsaraṃ pratīkṣeta dviṣantīṃ yoṣitaṃ patiḥ |
ūrdhvaṃ saṃvatsarāt tvenāṃ dāyaṃ hṛtvā na saṃvaset || 77 ||
For one year the husband shall bear with a hating wife; after the year he shall wrest her property and cease to co-habit with her. [Manu Smriti 9.77]
From Narada Smriti,
Let him not dignify with his love a barren wife, nor one who only bears daughters^ nor one who deserves blame, nor one who is constantly at variance with him; if he does, he partakes of her faults. [Narada Smriti 12.94]
From Parāśaramādhava, the commentary of Madhava (Vidyaranya) on Parashara smriti whose source is said to be in in Brahma Purana,
If the wife is one that puts obstacles in the way of the performance of religious acts, or is unchaste, or is very much diseased,—the husband shall abandon her, for the; preservation of his righteousness;—if she is harsh of speech, he shall not abandon her, but supersede her; nor shall he give up having intercourse with her.
So, what Ramanujacharya did was righteous according to Dharma.