There are alot of rumors about the sale. The most obvious one is that Ray and Greg wanted to secure their future as they were going to leave the company Others have said it is because of Bioware's economy and they would actually have gone bankrupt without EA. Either way i blame the Bioware founders. Money will always change people, and it will have a negative influence in the long haul.
Even though Bioware games have been highly praised they haven't sold that well comparing to other AAA games and as the price for developing has gone up so much, you need a big publisher to be a part of that market. Ofc Bioware could just gone the Kickstarter route rather than beeing a part of EA, but it came out a few years to late for that to be a possibility. CDRP has almost gone under twice now, because of rookie mistakes. The gaming industry is not a good place to work, its unstable and almost always will be. We'll see in the future if they have to compromise themself to keep on going or not.
Ray and Greg did not sell out to EA. Elevation Partners (an equity firm) went into partnership with Bioware and Pandemic Entertainment to the tune of $300 million dollars in 2005. The partnership was called VG Holding Corporation. Elevation partners was the major partner having invested the most money in the partnership.
Elevation partners wanted out of the partnership in 2007. Neither Bioware nor Pandemic had the money to buy Elevation Partners out. So Elevation partners put VG Holding up for sale and EA bought the company for $860 million. EA retained Ray and Greg as officers overseeing Bioware (for a time).
Pandemic was shut down in 2009.
Why did Bioware form a partnership with Elevation Partners? I can speculate that it was as you stated game development of AAA games is expensive. cRPGs are a niche market compared to other genres. So selling well in that niche does not generate the same amount of profit that can be plowed back into new game development that a sports or shooter game may have.
One of the reasons Mass Effect 1 came out was because of front money by Microsoft. Mass Effect 1 was suppose to be an XBox exclusive (which it was for six months) with Microsoft Game Studios being the publisher. .
EA was able to convince Microsoft to allow Mass Effect to come out on other platforms (Windows) after buying VG Holding.