Housing manager who criticised gay marriage wrongly dismissed