The ruling is the latest development in a yearslong battle over where to house the main office for the nation's premier law enforcement agency.