A judge dismissed the U.S. Department of Justice’s lawsuit that challenged two Virginia statutes, ruling they weren’t preempted by federal law.