There is a reason behind it. It is called favoritism. it also can work on the other end of it, be even more strick on them.
It works in the army too. 2 ppl that are dating are not suppose to be in the same chain of command. Others can fell that person being strick on them, or their partner thinks that they being to hard on them due to their relationship.