What could be causing my water heater inlet pipe to corrode?
I'm thinking that the installation is missing this dialectic union. Your "dialectric" nipple has an ABS plastic coating inside a galvanized steel pipe. If the dialectic union were used in conjunction with this nipple it would provide electrical isolation from the copper - galvanize connection. This document explains this in better detail.