We have calculated the donor defect profiles in pseudomorphic AlxGa1-xN layers grown on GaN, taking into account the effects of the strain polarization field on the defect formation energy. Under certain conditions, the defect concentration may be enhanced by more than one order of magnitude. These large concentrations combined with the band bending effects of the piezoelectric field makes the charge transfer from the AlxGa1-xN barrier to the GaN well extremely efficient, resulting in a two-dimensional electron gas of very high density and low mobility. These results explain recent experimental observations of large electron densities found in nominally undoped GaN/AlGaN heterostructures. © 1998 American Institute of Physics.