At first thought, it might seem that rainwater should be clean like distilled water, as it evaporated, condensed, then fell back to earth. It sounds like a condenser or distillation apparatus in a laboratory. But in reality, the process is very different.
To start with, every raindrop must have a particle to condense upon, called a cloud condensation nucleus. According to this Wikipedia article:
Cloud condensation nuclei or CCNs (also known as cloud seeds) are
small particles typically 0.2 µm, or 1/100th the size of a cloud
droplet on which water vapor condenses. Water requires a
non-gaseous surface to make the transition from a vapor to a liquid;
this process is called condensation. In the atmosphere, this surface
presents itself as tiny solid or liquid particles called CCNs.
Furthermore, the composition of CCN is frequently very acidic, having formed from sulfuric acid or sometimes weak organic acids. These types of CCN form in both polluted as well as pristine environments. Both natural and man-made sources of sulfur emissions result in the photochemical oxidation to sulfuric acid, which forms new CCN which are very hygroscopic (water absorbing).
The type of CCN described above are most commonly formed over land. In marine environments, there are natural sources of sulfur gases, but most CCN form from evaporated sea spray, which is of course much more pH neutral.
However, regardless of how the cloud drop was originally formed, they all have another source of acidity from the atmosphere; they absorb carbon dioxide, which is rapidly converted to carbonic acid when dissolved in a cloud droplet. It is this absorption of naturally occurring, acidic carbon dioxide that is the primary reason that essentially all rain is somewhat acidic.