strange behavior on my first robot with L298

Is your 9V battery one of those rectangular smoke alarm batteries? If so, that is a problem. Those batteries can not supply very much current. You need a power source that can supply the stall current of the motors.