Presumably you connected the wrong wires to red and black. But you didn't include a picture of how you connected the new switch.
You appear to have an original switch with two wires on one screw and one wire on the other screw. If you kept the wires together as they were, typically the two wires would be hot in and hot on to other devices, which should connect to the black wire on the new switch. The red wire would typically connect to the single wire on original switch.
If you ignored the grouping of the wires on the original switch because they were all black, life gets somewhat more complicated as you sort this out, but you will probably wind up the same place in the end when you sort out which black wire does what (one is hot in, one is hot on, and one is switched hot to the light you intend to control - almost always. Sometimes there's only hot in and two different hots to two different lights. Then there are three-way switches...but given your problem description, hot in, hot on, and switched hot to light are what you'll have.)