Motor works on 9V battery but not 9V power supply
If it runs on a 9Volt battery, but does crazy things on a 9Volt power supply, then it likelyis not meant for use on 9Volts.  

A lower voltage motor might run OK on 9Volts because a 9Volt battery can't supply much current - the voltage drops when the motor tries to draw a lot of current.

With a powersupply that can provide lots of current at 9Volts, the motor will try to draw lots of current - and it will get it.  A motor made for lower voltage may then run crazy fast and/or spray sparks and/or burn out.

Find out what voltage the motor is rated for. Small motors for toys typically run on 1.5Volts or 3Volts (two 1.5V cells in series.)