Just to elaborate, because eukaryotic genomes are so huge the marginal cost of copying excess genes is negligible so the selective pressure against them is as well. But prokaryotes have very small genomes and reproducing useless genes would be relatively disadvantageous for them so there is noticeable selective pressure to eliminate useless genes for them. So you will see the frequency of unused genes in bacteria tend to decrease over time.