A university has been fined after investigations found it had failed to uphold freedom of speech.