Means of contraception, including pills, may be used in a permissible manner, in cases in which it is used to delay pregnancy or prevent it for some reason, or they may be used in a haraam manner, as immoral people do.
The basic principle with regard to that which can be used for both halaal and haraam purposes, is that everything that it is thought most likely will be used for haraam purposes, it is not permissible to buy or sell it, because that comes under the heading of cooperating in sin and transgression.
Shaykh al-Islam Ibn Taymiyah (may Allah have mercy on him) said:
If it seems most likely that garments will be used to help commit sin, it is not permissible to sell them or sew them for one who will use them for sinful and wrongful purposes. Hence it is makrooh to sell bread and meat to one who you know will drink wine with them, or to sell herbs to one who it is known will use them for wine and so on. The same applies to anything that is basically permissible, if you know that it will be used to help commit sin. This varies from one place, time and situation to another. End quote.
Sharh al-‘Umdah, 4/386-387
In Fataawa al-Lajnah al-Daa’imah (13/109) it says: Everything that may be used in a haraam way, or it is thought most likely that that is the case, it is haraam to manufacture it, import it, sell it or distribute it among the Muslims. End quote.
Based on that, you should act on what you think is most likely the case with regard to those who use these pills, or whether the majority of those who use them, use them for halaal or haraam purposes. If the majority use them for haraam purposes, it is not permissible to sell them; if the majority use them for halaal purposes, there is nothing wrong with selling them.
You should remember that whoever gives up something for the sake of Allah, Allah will compensate him with something better than it. Allah says (interpretation of the meaning):
“And whosoever fears Allaah and keeps his duty to Him, He will make a way for him to get out (from every difficulty).
3. And He will provide him from (sources) he never could imagine. And whosoever puts his trust in Allaah, then He will suffice him. Verily, Allaah will accomplish his purpose. Indeed Allaah has set a measure for all things”
“and whosoever fears Allaah and keeps his duty to Him, He will make his matter easy for him”
Every time you think there is no way out, remember what Allah says (interpretation of the meaning):
“Allaah will grant after hardship, ease”
We ask Allah to give you sufficient from what He has permitted so that you will have no need of that which He has forbidden.
And Allah knows best.