A federal judge ruled Monday that Chicago's ban on virtually all sales and transfers of firearms is unconstitutional.