Why does my IR receiver spit out random codes when my motor is on?
Motors are noisy, and they dump noise onto their power supply rails.  You've done nothing to isolate the IR receiver from that noise.

You should have a capacitor from +5V to ground.  You probably want a "bulk" cap of 100uF or so, in parallel with a 100nF cap (and there's more than one way to do this "right", so don't be surprised at comments).

You should isolate the IR receiver from that noise.  If you're truly running the motor from a separate +5V supply, and intend to continue to do so, then power the IR receiver from the Arduino's +5V supply.  Better, if the receiver is rated for 3.3V operation, power it from the Arduino's 3.3V supply for better isolation.  Either way, put a 100nF cap in parallel with the receiver's power supply pins, right at the receiver package.

While you're at it, put in that catch diode that @KingDuken mentioned.  That's a diode, rated for your motor current (i.e., not something too wimpy) from the transistor collector to the motor's +5V supply.  Orient it so that it's reverse biased when the motor is on -- that way, when you shut the motor off suddenly, the inductive kickback won't destroy your transistor.