apfs snapshot changing after creation?
I think your conclusion is wrong - even if it looks that way superficially, the snapshot is actually not changed.

The thing that tricks you here is your one of the folders in your path is actually a link. If you're running on pre-Catalina macOS version, you probably have /Users as a symbolic link. If you're running on Catalina, /Users is a firmlink.

This means that when you run ls /private/tmp/snap/Users/dmd/foo to check for the file, you're actually not looking at a file inside the snapshot, but rather the system will traverse the link inside the snapshot and onto your ordinary volume for the actual file.

If you're on Catalina and want to redo your commands without the link interferring with you, you will need to instead use the following command to check for existence of the file inside the snapshot:

ls /private/tmp/snap/System/Volumes/Data/Users/dmd/foo