Separating different metals prevents problems. Plumbers use a nipple tray.
Your hot water heater hooks up to your water pipes. The different metals around an electrolyte, like tap water, it reacts – called galvanic corrosion, where atoms from one metal break off and cling to the other metal.
Some plumbers don’t like dialectric unions because they can be a source of leaks. And by the time the water heater needs to be replaced, often they’ve corroded, exactly what they aren’t supposed to do. Also, they just seem to be an unnecessary expense.