Lee marched into Pennsylvania because: [a]He did not want to be re-deployed to Tennessee with the bulk of his army [a plan being bandied about in Richmond], [b] He wanted to take the pressure off the farms of Northern Virginia for the summer of 1863, [c] He wanted to live off the agricultural bounty of Pennsylvania for a season.
Lee’s 1863 campaign was a raid, plain and simple. It only became an invasion after he got his butt kicked.
He wanted to rest Virginia from having to sustain two armies for the summer. And he wanted more than just the agricultural bounty from PA... he wanted to refit his army from shoes to hats. He needed everything.