"It was introduced in 1983 with the BMW M20 design as its basis. It was available with a turbocharger. It was also the last diesel sold in the North American market in the E28 and E34 before the reintroduction of a diesel by BMW in the North American market E90 in 2009, the BMW M57
http://en.wikipedia.org/wiki/BMW_M21

why was it phased out?

here in Europe, it is all the rage. and you routinely see 525TD with over 300 000 miles being sold here.