You have a couple of options. You can select snap to "plane only" in snaps before you draw... or if you have already drawn things then select all your 2D lines with the align tool (select Centers Vertical) in top view and then go to a side view (like right view) and click on the "along x" (or along y) line. This will put everything on the same plane.