That was discussed in the article as well. Longstreet suggested he take Hood's and Pickett's divisions to reinforce Bragg, which Lee strongly opposed. The article states that Lee won over Jefferson Davis and convinced Longstreet. A Longstreet letter stated that Lee assured him they would fight only on the tactical defensive in Pennsylvania. A goal that was not accomplished, was the destruction of rail lines in Harrisburg. Other rail lines were cut, but Harrisburg was a big prize. It didn't happen because the Army of the Potomac was closer than Lee thought.
The purpose of the raid was to influence the fall elections. That was evidenced in the letter to Jefferson Davis.
Harrisburg was lost due to Ewell's slow movements giving the militia time to burn the bridge over the Susquehanna. Ewell had plenty of time to get to Harrisburg, but moved slow due to the gathering of supplies.
Again, I would argue that Lee was not caught by surprise as popular and contemporary history and culture would lead us to believe.