The change in Gibbs Free Energy for a reaction (DeltaG_(rxn)) depends on the concentration of reactants and products, so an increase in pH increases DeltaG_(rxn) if H_3O^+ is a reactant, and decreases DeltaG_(rxn) if H_3O^+ is a product.
The general relationship between Gibbs Free Energy change for a reaction and the concentrations of reactants and products is
DeltaG_(rxn)=DeltaG^0+RTlnQ
where DeltaG^0 is the free energy change for the reaction under standard conditions (unit concentrations of reactants and products), and Q is the reaction quotient (actual product concentrations divided by actual reactant concentrations).
Example: H_3O^+(aq) + NH_3(aq) harr H_2O + NH_4^+(aq)
Q=([NH_4^+])/([H_3O^+][NH_3])
Note that H_2O does not contribute to Q because it is a solvent.
An increase in pH decreases the hydrogen ion concentration, [H_3O^+], thereby increasing Q (because it appears in the denominator of Q), and increasing DeltaG_(rxn).
An increase in DeltaG_(rxn) decreases the thermodynamic driving force for the reaction, and if DeltaG_(rxn) becomes positive the reaction is no longer spontaneous (i.e., the reverse reaction becomes spontaneous).