Amazon violated federal law when it refused to recognize a union, a judge ruled.