switch with 3 black wires
Sounds like you removed a 3 way switch and replaced it with a single pole switch.

If the old switch does not have on/off marked in the handle and it has three terminals it is a three way switch. You need to replace it with the same kind.

One of the wires is either the hot feed from the panel or it runs to the light. The other two wires are travelers running to another switch somewhere.