There is a good section in Wherever Green Is Worn (history of Irish soccer doc) which talks about the likes of Castleknock College being a big soccer school in the 19th century before moving to rugby.
It’s a mixture of factors with individuals involved with for example, Blackrock College (its said an Old Gamesmaster of the Rugby School brought it in) where the Holy Ghosts would have spread the game to their other schools when they opened (St Mary’s, St Michael’s, Templeogue). Then you’ve geography with that being where a lot of the Protestant schools were who liked rugby so you had the merchant Catholic class looking to interact with that. Rugby was also very very well organized (with the Army and Collegiate elements a factor) which lended itself to schools looking for a good extra curricular activity.
Rugby was actually played at more Christian Brothers schools in the early 20th century but once the nationalist zealotry came in it was restricted to the two fee paying schools and a couple of the others (Waterpark, Ard Scoil Rís to a lesser extent). The Christian Brothers actually sold the game in places like Argentina and Australia more than they did in Ireland.