See my answer to "Weighing mitzvot/aveirot". There I try to establish that Hashem doesn't judge actions, He judges the state of a person as they shape themselves through those actions. As I wrote (after opening with sources) there, "Yishmael was repaid in terms of 'ba'asher hu sham -- as he was there.' The way your soul stands at that moment is the direct cause of reward or punishment."
I think that's what the Rambam is saying here too. A person who sins once or twice... they made mistakes. A person for whom the sin became a habit, that's who they are.
The Raavad (ad loc) in his objection to this Rambam, invokes the verse I did about how Hashem judged Yishmael "as he was there". He understands the Rambam as conflating two gemaros:
1- Rosh Hashanah 16b-17a:
תנא דבי רבי ישמעאל: "מעביר ראשון ראשון" -- וכן היא המדה. אמר רבא: ועון עצמו אינו נמחק, דאי איכא רובא עונות מחשיב בהדייהו.
[A beraisa] was taught in school of Rabbi Yishmael: "He passes over the first, first" and so is the attribute [of Mercy, to forgive the first sin]. Rava said: But that sin itself is not ; if the person['s actions] are [still] mostly sins, G-d accounts for [the first sin too] for him.
2- Yuma 86b:
תניא ר' יוסי בר יהודה אומר: אדם עובר עבירה פעם .ראשונה מוחלין לו. שניה מוחלין לו. שלישית מוחלין לו רביעית -- אין מוחלין לו. שנאמר, (עמוס ב:ו) "כה אמר ה' על שלשה פשעי ישראל ועל ארבעה לא אשיבנו" (ונאמר) (איוב לג:כט) "הן כל אלה יפעל אל פעמים שלש עם גבר."
It was taught [in a beraisa]: Rabbi Yosei bar Yehuda says: When a person commits a transgression the first time, he is forgiven; a second time, he is forgiven; a third time, he is forgiven; but the fourth time, he is not forgiven, as it is stated: “So says Hashem: For three transgressions of Israel, but for four I will not reverse it” (Amos 2:6). And it says: “All these things does God do twice or three times with a man” (Iyov 33:29).
According to the Raavad, these two gemaros refer to two different times of judgment. The gemara in Rosh haShanah is saying that when a person is judged at the end of life, Hashem will overlook an initial mistake, if it doesn't fit their general character; ie if after ignoring the initial errors, the person is overall not a sinful person. Whereas the gemara in Yuma is talking about during the course of life, and the person can still change their behavior. Then, it is not until the sin is habitual that G-d will address the sin.
The Raavad's understanding of the Rambam's sources supports my theory that the Rambam's intent was to talk about which sins become "of the person" rather than a history of activity.