Two hot wires in switch junction box
Its a split/switched receptacle

And you forgot to break the tab off. 

At the other end of this cable, one of the wires (most correctly the white) is spliced in with the hot wire(s) going to one socket of the outlet.  The other wire goes to the hot terminal of the other socket. This causes this one socket to be switched-hot with the switch, while the other socket is always hot.   

This is done to support a floor lamp; it meets the technical requirements to have a light in the room that Code requires, without the expense of cabling an additional outlet (point of use) at the ceiling. 

When you did not break off the tab on that receptacle, you caused both sides (black and white) to be shorted, annulling the function of the switch.  

Hunt it down.  The giveaway will be a white wire where one is not expected (pigtailed with blacks, or on a brass screw).