What size is the tank, what size are the fish?
If the male is already in the tank and then you add the female, he may see her as an intruder even if it's a female of his own species. Better to add the female first and let her get comfortable then add the male. Also hiding spots that only the female can enter but not the male (if female is smaller) are important. Male aggression is often a part of the breeding process, need to give her a way to escape it. A plastic divider with a hole she can only get thru, or a flowerpot with the same sized hole, would do the trick.