This is technically not a legal question, but rather a question of how you are interacting with a child protection caseworker. The horse is out of the barn as the worker made a decision to tell your daughter the reason she was removed from your care without discussing this with you. I think that was a serious error in judgment on her/his part. If you have an attorney, you can discuss this issue with him/her. If not, and this is important, you can give us a call, schedule a consultation and develop a plan to deal with this.
Sometimes honesty is a better way to go. It is important that your daughter understands that it was nothing she did that caused her removal from your care. Perhaps it is OK for you to tell her that you made a mistake and that you have fixed the problem so it won't happen again. However, if you tell her this, you need to be sure that it doesn't happen again! Good luck!
Although you may disagree with the caseworker, the problem is that if you don't follow the recommendations of the caseworker, it will likely be reported to the Court at the next review hearing. You (or your attorney if you have one) could make the argument that such a recommendations would not be in the best interest of your child. However, you do run the risk of the Court disagreeing with you and of course, getting on the bad side of the caseworker which could have worse ramifications for your child than telling him or her about your drug use. I too wonder how it is that your child was removed from your care without this information already being passed to him or her but I don't know the details of your case.
Sign up to receive a 3-part series of useful information and advice about child custody law.