Bonding can be done, https://en.wikipedia.org/wiki/Direct_bonding but it's not easy. If you think about having to achieve atomic flatness and freedom from contamination, over a massive area... yeah. That it's doable at all is truly testament to the incredible precision used in these processes.
More often, either extra doping is introduced (by chemical deposition and diffusion i.e. physically introducing a dopant and baking it in, or more often in modern processes AFAIK, directly by ion implantation), or material is added on top by a chemical deposition process (epitaxy), which can contain dopant gasses thus giving a high purity N/i/P (as the case may be) layer. [i = intrinsic i.e. non-doped]
The fact that this is ultimately a printing process, is very valuable even to simple devices like diodes, as edge effects dominate their behavior at extremes of operating range, particularly surge immunity and leakage current. Sawing up a flat sandwich of P/N leaves a bare edge around the junction, contaminated by the sawing process, and subject to surface states; instead doping the surface allows the junction to curl up towards the surface, where it can be carefully controlled as part of the printing process (e.g. adding guard rings to control surface states, electric field profile, etc.).
These more subtle effects might not be important to solar cells (I forget if they are cleaved/sawed, or printed as above?), but essentially all commercial electronic semiconductors are made this way.