jremington:
Always necessary to connect the grounds.The 9V battery might be able to spin one motor for a couple of minutes before dying. But don't count on it!
Like jreminghton said, i guess is the lack of ground between the arduino and the l298, because on the images you posted i cant see any wire connecting the 2 grounds