Why does my motor turn on with this sketch?

#include "DualVNH5019MotorShield.h"
DualVNH5019MotorShield md;
int keyUp = 10;
int keyDown = 11;
void setup()
{
  pinMode(keyUp, INPUT_PULLUP);
  pinMode(keyDown, INPUT_PULLUP);
  md.init();
}
void loop()
{
  if(digitalRead(keyUp)== HIGH && digitalRead(keyDown)== HIGH)
    {
     md.setM1Speed(0);
    }
  if(digitalRead(keyUp)==LOW)
    {
    md.setM1Speed(400);
    }
  if(digitalRead(keyDown)==LOW)
    {
    md.setM1Speed(-400);
    }
}

So i have put this sketch together to control forward and reverse of my motor. The key up and down is part of my on off on switch. As soon i turn power on to my motor control shield (VNH5019 dual channel remapped to single channel) and the Arduino is plugged in my motor starts to spin without me turning my switch on.

I'm not familiar with that motor shield or the library you're using to control it. Does it come with example sketches showing how to use it? If so, I suggest you test your setup with the standard examples before you try creating your own version.

Without a schematic, you aren't going to get any meaningful help. Show us how your switch(s) is(are) wired. You speak of am on/off switch, but your code shows either two switches being checked, or some sort of arrangement of your switch that affects two different pins.