Using Earnwt and excluding self employment and only those that get wage and salary. In the year 2017 there are 2,028,420 workers that are members of a labor union (15.4%) of the working population. However on BLS site they have 2,491,000 (15.5%) of the working population. Am I doing something wrong?
You have not done anything wrong. In general we do not expect to exactly replicate official published statistics with public use microdata. This is largely due to confidentiality requirements and other restrictions placed on public use data compared to restricted use data. We do, however, expect to be within some margin of error of published statistics and this certainly seems to be the case with this comparison.