If the plug wasn't connected to anything at the time, then either the two wires touched, or your tools connected the wires, or there is a short between the two wires inside or at the entrance to the connector itself.
If the plug was connected to something at the time, then it could be wrong polarity or whatever it is connected to is shorted somewhere along the wire path within the cable sheath between your connection and the connector.
There's no way to get a spark (meaning current flow) without an electrical path, so the path would have to go from the wires you're connecting thru a short somewhere between the wires you're connecting and the end of the connector or whatever it was plugged into.
You can measure just the connector and it's two wires, not connected to the battery, with your multimeter set to 2 ohms or continuity. Doesnt matter which lead is on which wire. You should get no beep or tone, and a maximum reading, usually 1. or OL or similar (check your meter's manual for what it shows on open circuit). If you get anything else, it means there is a short between the connector pins or wires, so you would need to fix that before you can connect it to your battery.
If the spark was large, with smoke, it almost certainly left arc flash or heat damage at the short circuit point, so you can carefully examine the cable and connector for this to find the short.
If the short was sufficient current, it could have damaged the battery's BMS, as they usually have no protection against reverse current (discharge) thru the charge port. Usually this failure is stuck on, so you'll probably still read correct voltage at the charge port, but the BMS won't be able to turn that port off anymore when charging once any cell reaches HVC, so it could then overcharge cells.
Just to be careful, I recommend monitoring all the cells during charge the next few times you charge it up, to make sure none of them exceeds HVC (usually 4.2v or less for Li-Ion), and that the charge port turns off (the charger usually shuts off too) when any cell does reach that point.