Current flow from positive to negative no matter whatever load you put there will be flow of current. In this case the wire acts as load, as no work or charge is required for the wire heavy current flows. The spark is produced because of improper connection of the wire. If you hold both wire together firmly then you can notice the wire and battery will heat up.
You get a spark because all that current suddenly has a place to go: Ground. This puts a heavy load on the device and in all probability will destroy it or if it’s well designed will either destroy the overload fuse or better, trip a crowbar circuit. That spark represents the sudden discharge of a circuit (perform the experiment with a car battery: well, don’t do that. It could cause an explosion!) The electrons want their anode, bad, and since you just gave them a clear path to it, zap.