Religious freedom is "a cornerstone of any just society" and contributes to building peace, Pope Leo XIV said.