UPS batteries are really dangerous because you cannot turn them off. They are also high enough voltage and current to harm you through arc flash and burns.
The other thing with small UPS batteries is that there are usually multiple batteries. There are fuses between the battery string and the circuit board but not between each battery in the string.
OP may have connected batteries wrong or he put a new battery in a string with a shorted/dead battery.
Whenever you are going to string multiple batteries together always disconnect batteries and check voltage on each separate battery to make sure that they are the same or very close in voltage. If different charge to the same level. Any difference in voltage between the cells will cause current flow that can cause a fire hazard.