Leonard's law says that the school can restrict speech if it is
against the religious tenets of the organization. Now I don't think
school uniforms fall are part of the tenets of Catholicism, so why can
private schools enforce dress codes?
I see there's a misunderstanding of the Leonard's law. But I fault the California legislators (not you) for that confusion, since the statutory language is ambiguous and leads to the reasonable interpretation your inquiry reflects. The statute reads:
(c) This section does not apply to a private postsecondary educational
institution that is controlled by a religious organization, to the
extent that the application of this section would not be consistent
with the religious tenets of the organization.
It is not that a religious school is allowed to restrict speech if it contravenes the tenets of that religion, but that the statute altogether is inapplicable to religious schools because it is considered an infringement of fundamental liberties to which religious institutions are entitled in the US.
The [religious] school would prevail on the basis of the ecclesiastical abstention doctrine. See Dermody v. Presbyterian Church (U.S.A.), 530 S.W.3d 467, 474 (2017):
The ecclesiastical-abstention doctrine prohibits courts from deciding
cases "dependent on the question of doctrine, discipline,
ecclesiastical law, rule, or custom, or church government[.]".
(Please note that I strongly disagree with the application of that doctrine in the Dermody case and I consider it impermissibly outdated for the controversy litigated therein, but that is a separate issue).
A religious school could convincingly argue that the judicial review of its uniforms policy infringes matters of ecclesiastical discipline/rule/custom, aspects which ultimately "involve an internal church dispute over religious authority or dogma" Roman Cath. Archbishop of LA v. Super. Ct., 32 Cal.Rptr.3d 209, 220 (2005).
Infringements of ecclesiastical abstention and akin doctrines would be outweighed only in
"compelling" [cases] because "the duty to prosecute persons who commit
serious crimes is part and parcel of the government's `paramount
responsibility for the general safety and welfare of all its
Roman Cath. Archbishop of LA v. Super. Ct. at 225 (brackets added in this answer). A free speech controversy such as the school's uniform policy simply does not meet that threshold.