Most often the red wire in a lighting circuit is a switch leg. Very likely there is a black/white pair coming in from the panel, black/white/red going to the switch box, and then black/white continuing from the switch box to some other outlet.
If this is the case, the black is the hot wire from the panel and will be attached to one side of the switch, the red will be attached to the other side of the switch, and returns power to the light box when the switch is on.
Personally I would take things back apart and test it out with a meter to confirm, but you can also take off the switch cover and check which color wires are hooked up to it. If it follows the pattern I described, then moving the black wire of your new fixture over to the red wire in the box should solve the problem.