Assuming you deal with software, I'd guess that's because someone has committed them to a repo. It's one of the reasons Mac-based devs should always have a global .gitignore file.
I miss Asepsis. It was a daemon/dynamic library that would redirect the .DS_Store file location. Unfortunately, it can't run on modern Macs due to System Integrity Protection.
In the old days, that's exactly what Apple did with HFS. The issue there is that other filesystems, and notably remote filesystems such as one might access with FTP or NFS or whatnot, did not support that. For portability across filesystems, Apple started using .DS_Store files.