There are number of reasons. The manufacturers take into account the properties of medicines first. Chemical properties of some medicines change and efficacy reduce on their being exposed to humidity or oxygen in the air. Doses of such medicines have to be packed in capsules. A capsule also becomes necessary in case of bitter dose. If tablet form is essential then that tablet has to be coated with a tasteless material. Whether digestive system has to assimilate the dose immediately or gradually in the stomach is also an important matter to be considered. A dose meant to be assimilated gradually is best administered in the form of a hard tablet because capsule ordinarily made of gelatin is quickly dissolved by the acidic gastric juices of the stomach.
It is possible to give this kind of dose in capsule also provided that the dose is in granular form and not in powder form. In such a case overriding medical reason is assimilation of the dose in small quantities spread over a long period rather than assimilation of the entire dose in a few minutes.