Why did James Joyce write in English?

For two centuries English has been the majority language in Ireland.
By the 1890s the gaeltacht (native-Irish speaking community) was restricted to a small number of remote areas in the west. There was a Gaelic revivalist movement but as Joyce brilliantly portrays in The Dead (1914) this largely consisted of earnest nationalist intellectuals like Miss Ivors. She berates Gabriel as as a 'West Briton':
"O, Mr. Conroy, will you come for an excursion to the Aran Isles this summer? We're going to stay there a whole month. It will be splendid out in the Atlantic. 
You ought to come. Mr. Clancy is coming, and Mr. Kilkelly and Kathleen Kearney. It would be splendid for Gretta too if she'd come. She's from Connacht, isn't she?"
"Her people are," said Gabriel shortly.
"But you will come, won't you?" said Miss Ivors, laying her arm hand eagerly on his arm.
"The fact is," said Gabriel, "I have just arranged to go----"
"Go where?" asked Miss Ivors.
"Well, you know, every year I go for a cycling tour with some fellows and so----"
"But where?" asked Miss Ivors.
"Well, we usually go to France or Belgium or perhaps Germany," said Gabriel awkwardly.
"And why do you go to France and Belgium," said Miss Ivors, "instead of visiting your own land?"
"Well," said Gabriel, "it's partly to keep in touch with the languages and partly for a change."
"And haven't you your own language to keep in touch with -- Irish?" asked Miss Ivors.
"Well," said Gabriel, "if it comes to that, you know, Irish is not my language."
Gabriel's attitude to Irish mirrors that of his author. Joyce left Ireland in June 1902, with a sound knowledge of French, Italian and Latin - but no formal education in the Irish language. He was forty when the formation of the Free State (1922) allowed the Miss Ivors to gain the upper-hand over the 'West Britons'.  For the first time Gaelic became a compulsory subject in Irish schools, a status it has retained ever since.