The law you're calling "poorly written" is the law that defines trespassing as a crime. It allows your friends to enter your property without becoming criminals. Your version would make anybody besides the owner a criminal if they were to enter your property for any reason.