There are many reasons these may be pacakaged this way: from lowering the possibility of accidentally taking the wrong pill to anti-theft.
It would be cheaper for the manufacturer to just put them all in a bottle, so rest assured they wouldn’t do this if the benefits didn’t outweigh the costs.