It's best never to take the car out of gear while moving for safety reasons - with the car in neutral, you have only limited control. This is equally true in manual as well as auto. When I took my driving test, coasting (in a MT car) was classed as a dangerous mistake and would result in an immediate fail.
There may also be mechanical reasons for not coasting in N - most modern auto boxes use only 'front' oil pumps for lubrication and hydraulics (the pumps are powered by the engine). This means that a decent engine speed is required to get proper lubrication to all the components of the transmission. In neutral with the engine at idle there may not be enough lubrication to ensure correct operation while moving.
Certainly, you should never tow an AT car with the engine switched off unless the driven wheels are off the ground, because without the engine powered lubrication pump running the transmission will wear out very quickly. (Very short distance towing at a very low speed may be acceptable in an emergency)
To see why there is opportunity for wear changing from alternately from N to D requires a little knowledge of how an AT works. However, it is worth remembering that the change from N to D will occur at idle, so is generally a very low stress operation.
The first part of an AT is the torque converter - it goes between engine and gear box and allows the gearbox to turn at a different speed to the engine - basically the engine drives an oil pump, the oil then turns a turbine connected to the GB.
When drive is selected the the gears in the GB are engaged - so the input must turn at a speed related to the road speed of the car. If the car is stopped the input to the gearbox must also be stopped. This means that when the car is stopped, the only moving part in an AT is the engine side of the torque converter (and the lubrication and hydraulic pumps).
When the transmission is in neutral - the GB is disengaged, so the input shaft will spin at the speed of the engine regardless of the road speed of the car.
When you engage drive, appropriate clutches and brakes are activated to select 1st gear. As these engage they will act against the spinning input shaft, and will have to bring it to a stop as the gear engages. There is therefore a small amount of wear on the friction materials. It's only likely to be very little - probably less than a normal gear shift while driving.
In general the safety benefits of having the car out of gear at a junction probably outweight the tiny amount of wear that it could cause.