I understand that when electrons diffuse from n-side to p-side, negative charge is developed on the p-side. But the mere absence of electrons on the n-side doesn't make that positively charged. The n-side must be neutral as it has no charge now. Where am I getting wrong?
The pn-junction consists of fixed and mobile charges. The n-side has an abundance of electrons and the p-side had an abundance of holes. These are the mobile charges.
There is an abundance of charge carriers because of doping. Foreign atoms are introduced into the crystal. Some have an additional electron in the outer shell (n-type dopants), and some have one less electron in the outer shell (p-type dopants). For example, if you are doping silicon (4 electrons in outer shell) you can use Boron (3 electron IB outer shell) and Phosphorous (5 electrons in outer shell).
The dopant are fixed in place in the crystal lattice. Therefore when the mobile charges flow towards each other, they leave ionised dopants behind. For example, the n-type dopant has lost an electron, therefore it has a positive charge on +1. Similarly the p-type has gained an electron so it has a net negative charge of -1. Thus the n-type contains positive space charge and the p-type is negative.
When n and p crystals are brought closer the excess electrons in n and excess holes in p begins to diffuse to p and n region respectively which is a phenomena relating to the concentration gradient. The electrons which diffuse in the p region from n region actually come from the donor ions (like P, As ). So as these electrons travel from the n semiconductor to p they actually make the ions deficient of electrons giving them a positive charge. Therefore a region of positive charge is created on the n side.