In the alternative, after failing to break Meade's position, Lee might have accepted that there was no victory to be had and disengaged at the end of the second day, using Stuart's newly available cavalry. More speculatively, Lee might have disengaged and begun a mock retreat hoping to lure Meade out of position into an ill-organized pursuit so he could be ambushed and destroyed in detail while en marche.
As it was, Lee attempted a frontal assault over a long open field against a prepared position. Lee -- seemingly blind to his casualty lists -- did not fully accept that such a Napoleonic tactic was no longer viable due to the increased effectiveness in firepower over maneuver that became evident during the Civil War.
In fairness to Lee, he and the South realized that the North's growing strength and battlefield success were grinding the Confederacy down. Ultimately, the air of desperation about Lee's decisions at Gettysburg was rooted in the Confederacy's declining strategic position. Again, winning battles but losing the war results in getting demoted down the list of great generals.
Lee attempted a frontal assault over a long open field against a prepared position. He did exactly the same thing at Malvern Hill in 1862. The results were exactly the same as with Pickett’s charge.