It was a test. YG would still love XLU even if she were raped by 100 men. YG was abandoned and bullied, XLU was the only person who really looked after him. YG loved her because of who XLU was, which had nothing to do with external things.
Yes GJ did love him, but GJ is a moron. He would rather see YG being beaten to death than letting YG betrayed his Shifu; the stupid Quanzhen people.