I would suggest you read Stephen Sears Gettysburg, for a look at Meade’s thinking on the night of July 3rd. IIRC, Meade held a council of war, and it was nearly unanimous among the Union generals to NOT attack on 4 July. Remember that by the evening of July 3, John Reynolds of I Corps was dead, and Hancock and Sickles of II and III Corps were wounded, and Sykes had commanded V Corps for all of 4 days, after Meade had assumed Army command.
I, II, III, and XI Corps had been seriously chewed up by the fighting, I and XI on July 1, and II and III on July 2, with II Corps taking the brunt of Pickett’s Charge as well. XII was holding the Union right over on Culp’s Hill, and V the left based on the Round Tops. VI Corps was largely intact, but they had spent July 2 making a grueling 30 mile forced march in the July heat, and ‘Uncle John’ Sedgewick was not the Union’s fiercest driver of his men. Perhaps a prompt counter-attack might have carried the CSA lines, but the Union corps had been broken up into individual brigades and divisions on July 1 and 2 to merely hold Cemetary Ridge and the Round Tops, coupled with the difficulty in coordinating army movements in the pre-wireless age would’ve made the decision to counter-attack extremely difficult to implement.
Couple these with the fact that Confederates on Seminary Ridge would’ve had the same advantages the Union had in defending Cemetary Ridge, along with the rainstorm on July 4, and a successful Union attack seems less and less likely. In fact, I’m sure Lee and Co. would not have minded trying to repulse a Union assault against strong defensive sites. Meade did an excellent job in his first battle, clearly out-generalling Lee, stopping the Army of Northern Virginia and forcing it to withdraw, I feel that with the casualties inflicted on the Army of the Potomac, destroying Lee’s army on July 4 was not a credible choice.
Meade’s biggest failure though was his slow pursuit once it was clear Lee had skeedaddled. A more forceful response on July 5th might have pinned Lee up against the flooded Potomac and given Meade a chance to wipe out Lee. But, as the Civil War showed time and again from Fredericksburg through Pickett’s Charge to Cold Harbor to Petersburg, the tactical defense was stronger than the offense.
In fact, Sears related a story about Lincoln, who on hearing of Lee’s escape, wrote a letter to Meade taking him to task for that, and who then put it in his desk drawer, never sending it to Meade. Certainly, Lincoln recognized the missed opportunity, but also realized that Meade had performed quite well, based on the situation he found himself in on June 30 when he received the order to relieve Hooker.