The south could easily have won this battle, if not for some bad planning and bad communication, none of which would have happened had Stonewall Jackson not been killed. But, in my opinion, Gettysburg was not THE pivotal battle of the war, as it is often portrayed. Lee's hope here was that a victory on northern soil would force lincoln to the negotiating table. If that failed, he hoped that England, France, or both would come to the aid of the CSA. I don't think either of these were realistic goals, particularly since this battle came after the Emancipation Proclamation. Additionally, the CSA had already lost the west, Vicksburg, and most of Tennessee. Lee acted foolishly, and I don't think the outcome would have been very different, even if the south had won this battle. In other words, the tide had already turned.
Response to Virile: 1) The Confederate high water mark was in 1862. By the summer of 1863, southern supplies were wearing thin and they had lost control of approximately 1/2 of their territory. 2) Since Stonewall Jackson was killed before this battle, no one will ever know with certainty whether or not hs presence would have changed the outcome. One thing historians agree on however, Jackson most certainly would have taken Cemetary Hill. This is where Ewell froze and failed to act. This position was virtually unoccupied by federal troops and commanded the town. Thousands of Confederates were massacred the following day trying to take the position, after Ewell let Union troops fortify there. That is why I posted what I did about Jackson in the original comment.