I do wonder why some pills taste awful and others taste nice. I have had sodium valproate (Epilim) before and they didn't taste like anything but they are also anticonvulsants. But they were a nice purple colour.
I think the company that makes them decides whether medications should have flavours added.
Some medications are flavoured so that children will take them more readily.