Why is the boundary term in the Einstein-Hilbert action, the Gibbons-Hawking-York term, generally "missing" in General Relativity courses, IMPORTANT from the variational viewpoint, geometrical setting and the needs of Black Hole Thermodynamics? Shouldn't it be also included in modern courses of General Relativity despite its global effect on the equations of motion is irrelevant (at least in the classical theory of relativistic gravity)?
Two points. First, the variation of the GHY term is discussed in detail in this post:
Second, the GHY term on its own is enough to render the boundary value problem well-defined, but it is not sufficient for a physically interesting variational principle. This requires additional surface terms in the action, discussed by Regge and Teitelboim in the Hamiltonian formulation
and by Mann and Marolf in the Lagrangian case