The gastrointestinal tract is lined with epithelial cells.  Drugs must pass through or permeate these cells to be absorbed into the bloodstream.  Cell membranes may act as barriers to some drugs.  They are essentially lipid bilayers which form semipermeable membranes.  Pure lipid bilayers are generally permeable only to small, uncharged solutes.  Hence, whether or not a molecule is ionized will affect its absorption, since ionic molecules are charged.  Solubility favors charged species, and permeability favors neutral species.  Some molecules have special exchange proteins and channels to facilitate movement from the lumen into the circulation.
Ions cannot passively diffuse through the gastrointestinal tract because the epithelial cell membrane is made up of a phospholipid bilayer, comprising two layers of phospholipids in which the charged hydrophilic heads face outwards and the uncharged hydrophobic fatty acid chains are in the middle of the layer. The fatty acid chains repel ionized, charged molecules. This means that the ionized molecules cannot pass through the intestinal membrane and be absorbed.
The Henderson-Hasselbalch equation offers a way to determine the proportion of a substance that is ionized at a given pH.  In the stomach, drugs that are weak acids (such as aspirin) will be present mainly in their non-ionic form, and weak bases will be in their ionic form.  Since non-ionic species diffuse more readily through cell membranes, weak acids will have a higher absorption in the highly acidic stomach.
However, the reverse is true in the basic environment of the intestines—weak bases (such as caffeine) will diffuse more readily since they will be non-ionic.
This aspect of absorption has been targeted by medicinal chemists.  For example, they may choose an analog that is more likely to be in a non-ionic form.  Also, the chemists may develop prodrugs of a compound—these chemical variants may be more readily absorbed and then metabolized by the body into the active compound.  However, changing the structure of a molecule is less predictable than altering dissolution properties, since changes in chemical structure may affect the pharmacodynamic properties of a drug.
The solubility and permeability of a drug candidate are important physicochemical properties the scientist wants to know as early as possible.