Of course the school had the right to ban it. It is a religious text spoken at a public event on the tax payer dime.
If they would have given a disclaimer on the commencement pamphlets claiming that the student's speeches are their own and don't represent the views of the school than it would have been fine.
You have to be clear when you are in the public sector. No religion should be valued over any other idea when in the public forum (paid by taxpayers).
It's not just this certain piece of scripture, but any words in any religious text that are not allowed. For good reason too.