Whether or not his comment is homophobic or not is secondary. What business is it of his employer what he says and thinks outside of work time?
If he’s posting under the login of his employer, then he’s representing them and that needs to be dealt with accordingly of course. If not, they have no jurisdiction. The article even says this:
The Trust previously said its Code of Conduct was updated in 2010 to establish the proper use of social networking sites such as Facebook.
Under the code, staff are expected to ensure their opinions cannot be mistaken as being the opinions of the Trust.
How can they justify demoting him; “well, we’re demoting you because we found out you’re an old-fashioned godbotherer”?