One of the ways to explain is the application of Kirchhoff's voltage law: in a closed circuit the sum of all voltages is 0. (see https://en.wikipedia.org/wiki/Kirchhoff%27s_circuit_laws#Kirchhoff.27s_voltage_law_.28KVL.29)
Regarding a circuit consisting of only a voltage source and the diode (reverse biased), anything but the depletion region has a relatively low resistance. And the current is constant (though very low) within the circuit.
Hey presto - the voltage (aka 'electric field') has to be within the depletion region.
Let us imagine that a pn junction where p-type is on the left side and n-type is on the right side. Further, let the junction position be at the origin such that the width of depletion region is w = xp + xn where
xp is a distance of depletion region invading into the p-type (i.e., left side of the origin)
xn is a distance of depletion region invading into the n-type (i.e., right side of the origin)
Suppose that p-type has acceptor concentration of Na and n-type has donor concentration of Nd. Since the number of negative ions (due to ionized acceptors) and the number of positive ions (due to ionized donors) in the depletion region must be equal, we get
q A Na xp = q A Nd xn
where q is the electron charge and A is the cross-sectional area of the junction.
It means that the larger part of depletion region is in the lower doping side. For instance, if Na > Nd, then xp < xn. Also, it will be shown later that the maximum electric field is NOT always at the center of depletion region if the doping levels of p- and n-type are not equal
To find the electric field (E) with the charge density already known, Poisson's equation is recalled. Two equations are consequently obtained:
For 0 < x < xn : dE / dx = q Nd / epsilon ......(1)
For -xp < x < 0 : dE / dx = - q Na / epsilon ......(2)
Eq. (1) tells that E increases when x increases from 0 to xn and Eq. (2) indicates that E decreases when x increases from -xp to 0. With intuitive thinking, there must be a maximum electric field at some certain position within the depletion region. And it's done! That position is the junction (i.e., the origin).
Again, the maximum electric field is at the center of depletion region only if the doping levels of p- and n-type are equal.
You question can be answered very simple and without any mathematics: Make yourself a schematic drawing of the distribution of the fixed charges in the space-charge region. (Your drawing need not be numerically correct at all, it just needs to represent the general situation correctly.) From this drawing you can quite easily determine the position of the maximum of the electric field by having a look at the total charge found right and left of any possible position. Thereby you will come to the following observation:
The maximum of the electric field is always at the border between the p- and the n-type region, since there (and only there) all charges of one kind add up to the maximum possible value. At positions away from the border the electric field is smaller since (i) towards one side only part of all charge of one sign is present, and (ii) towards the other side some screening due to opposite charge occurs.
There is a space charge region straddling the p-n junction with fixed positive charges on one side and fixed negative charges on the other side. If you integrate Poisson's Equation from some distance away from the space charge region, the electric field starts at zero and increases as you move past fixed space charge on one side of the junction. The Electric Field gets stronger as you move past more space charge progressing towards the junction, reaching a maximum at that point because of accumulating the same sign charge. At the junction, continuing to progress in the same direction, you begin moving past opposite polarity charges, bringing the Electric Field to lower values, so the peak Electric Field occurs at the metallurgical junction. Poisson's Equation tells the story.
Well, I disagree to some extent: Poisson's Equation allows one to quantify both the electrostatic potential and the electric field, but to understand the situation qualitatively (which suffices to answer Manoj's "why" question), one just needs to know Coulomb's Law -- i.e. that charges are the origin of eletric fields and that the field strength is proportional to the amount of charge.
Yet, let's double-check: Would there something go missing if one doesn't use Poisson's Equation in the case discussed here?
Agreeing with Jan- Martin, the space charge region around the metallurgical contact of a pn junction consists of two equal and opposite charges where a positive charge resides in the n-side and an equal negative charge resides in the p-side. The electric field lines starts at the positive donor ion charges and terminates on an equal negative acceptor ion charges. Then the highest number of electric field lines will be at the plane separating the two charge distributions which is the metallurgical junction. So, peaking of the electric field is because of the overall neutrality of the positive and negative charges in each side of the junction.
For the detailed space charge distribution, the electric field distribution and potential distribution in a pn junction please refer to the link: Book Electronic Devices