There is a Machloket between Rif and Rambam. The subject is beginning in massechet Brachot. mishna Chapter 3,4.(in Gemara folio 20B)
A BA'AL KERI (a man after having seminal emission) SAYS THE WORDS [OF THE SHEMA MENTALLY WITHOUT SAYING A BLESSING EITHER BEFORE OR AFTER AT MEALS HE SAYS THE GRACE AFTER, BUT NOT THE GRACE BEFORE. R`JUDAH SAYS: HE SAYS THE GRACE BOTH BEFORE AND AFTER (Soncino)
I will quote the Bartenura on the Mishna concerning baal keri. as an abstract of the Gemara and after this explain through a few lines of Gemara the difference between diverse Rishonim. Bartenura:
עֶזְרָא תִּקֵּן שֶׁלֹּא יִקְרָא בַּעַל קֶרִי בַּתּוֹרָה בֵּין שֶׁרָאָה קְרִי לְאוֹנְסוֹ בֵּין לִרְצוֹנוֹ עַד שֶׁיִּטְבֹּל. וְלֹא מִפְּנֵי טֻמְאָה וְטָהֳרָה שֶׁאֵין דִּבְרֵי תוֹרָה מְקַבְּלִין טֻמְאָה אֶלָּא כְּדֵי שֶׁלֹּא יִהְיוּ תַּלְמִידֵי חֲכָמִים מְצוּיִין אֵצֶל נְשׁוֹתֵיהֶן כְּתַרְנְגוֹלִים ... וּכְבָר נִפְסְקָה הַהֲלָכָה דְּבִטְּלוּהָ לִטְבִילוּתָא, וּבַעֲלֵי קֶרְיִין קוֹרִין קְרִיאַת שְׁמַע כְּדַרְכָּן וְעוֹסְקִין בַּתּוֹרָה וּמִתְפַּלְּלִין וּמְבָרְכִין כָּל הַבְּרָכוֹת וְאֵין מְעַרְעֵר בַּדָּבָר Ezra ordinate a law about men with a Status of baal keri. In Tora, baal keri status originally concern uncleanness and cleanness laws and not prayer and learning Tora; see Mishna Kelim 1, 1 (semen makes unclean the person that touches it and the person from witch it originates). The verses cited above in the OP are included in the corpus uncleanness and cleanness laws.
The ordinance of Ezra Ezra ordinated a law concerning this uncleanness. A man after having a seminal emission is not allowed to read Torah until he clean himself in a Mikve.
Rabbi Bartenura says that the purpose of was in order that scholars might not always be with their wives like cocks. We will see that this is an interpretation of the Gemara and not a translation. their sources are probably 2 passages of Gemara: the gemara cited bellow that contain the expression "with their wives like cocks, and a Gemara in 22B:
Ezra ordained that a healthy man whose emission is voluntary must immerse in forty se'ahs". He builded a new statement. The legislative intent was to prevent an excessive amount of marital relation in Scholars. But this enactment had been canceled. They are now allowed to learn tora, pray and bless.
In this, the Bartenura follows the conclusions of the Rambam. Gemara 22A
R' Nahman Bar Isaac said: It has become the custom to follow these three elders, … and R' Judah Ben Bathyra in the matter of words of Torah. (see above : R'Judah B`Bathyra used to say: Words of Torah are not susceptible of uncleanness) … etc.… When Ze'iri came [from Palestine], he said: They have abolished the ritual ablution (immersion).Then, the Gemara comment a Berayita that says
A ba'al keri on whom nine kabs of water have been thrown is cleanAnd they debate about the dissemination of this teaching:
The one who taught 'he whispered it' thought that the reason was in order that scholars might not always be with their wives like cocks.The Rif wrote:
איכא מאן דאמר האי דאמרי בטלוה לטבילוטא בין לדברי תורה בין לתפילה ואיכא דאמרי הני מילי לדברי תורה אבל לתפילה צריך בטיבלה ולאו טבילה דווקא אלא רחיצה בט' קבין. וכתב רבינו האי גאון זצ"ל כיון דגמרא ליכא בהאי מילתא נקוט מנהג כל ישראל שכל בעלי קריין אף על פי שאין להם מים אין מתפללים עד שירחצו. The Rif concluded following Rav Hayi Gaon that for prayer the enactment is not annulled and Baal Keri need at least 9 Kabim. But Rabenu Yona and Rambam do not agree and the Shulchan Aruch follows clearly the Rambam that the "Ezra's immersion" was completely cancelled S.A. O.C. 88 But Magen Avrohom, cited in Mishna Brura calls those tha continue the minhag as Anshey maasse (people with a great behavior). This minhag is very good (note that it is a little different from a daily Tevila). {In Gemara, different types of Baal keri are distinguished, immersion in mikve and 9 kabim water thrown, in Rishonim, dinim of Hatsitsa. see in poskim}