How do I add an electrical switch for a closet light using an existing light switch?
Your light and switch arrangement needs hot and neutral to function.  You tapped it off the light switch in the bedroom, which only has hot and switched-hot (marked as white with black electrical tape).  That is not a good place to get power.  Here's what's happening: 

With the bedroom switch on, the two pins on the switch are shorted out, so both power wires to the closet have the same voltage.   It can't function.

With the bedroom switch off, current flows from hot, through your closet switch, through your closet lamp, and then through the bedroom lamps and to neutral.  The lights are in series.  That would light - dimly - with incandescents, but smart bulbs won't like it at all.  

You cannot tap power at the switch if there's no neutral there.  You should tap it at the bedroom light, where neutral is available.