If you look at the distribution of defect_class and select a couple and subset them, you will see that the duplicate ID rows show up for some defect classes and not others. I'm not entirely sure what is happening, but I think what you might want to use is Analyze - Tabulate and put defect_class in the columns and ID in the rows and then put the N_rows int the table portion (selecting either mean, N, max, or some other statistic, as appropriate).