Why do all of the .dmg files I download end up on my desktop? When I download a .dmg file it somehow ends up on my desktop automatically. Even after I install the .dmg, it is still on my desktop.

How do I stop these from appearing on my desktop? Should they be there?
If you mean volumes that are shown after you mount dmg files, you can uncheck this checkbox:



You can eject volumes from Finder's sidebar or by selecting their icons and pressing ⌘E.