The intention was to humiliate the visitors through sodomy, which was standard practice used by Hebrews on their fallen male enemies.  This act of rape most certainly violated hospitality codes in form and intent. It had nothing to do with homosexuality as we now know it.  It was not intended to be an act of sexuality, but an abusive act of violence against strangers.