Here's why:
* Direct object pronouns replace the direct object of a verb. In this sentence, "la cuenta" is the direct object of the verb "paga."
* "La" is the feminine singular form of the direct object pronoun, which is used because "la cuenta" is feminine singular.
Therefore, the sentence with the direct object pronoun would be:
Mi amigo la paga. (My friend pays it.)