The classical problem of attitude stability in a central gravity field is generalized to that on a stationary orbit around a uniformly-rotating asteroid. This generalized problem is studied in the framework of geometric mechanics. Based on the natural symplectic structure, the non-canonical Hamiltonian structure of the problem is derived. The Poisson tensor, Casimir functions and equations of motion, which govern the phase flow and phase space structures of the system, are obtained in a differential geometric method. The equilibrium of the equations of motion, i.e. the equilibrium attitude of the spacecraft, which corresponds to a stationary point of the Hamiltonian constrained by Casimir functions, is determined from a global point of view. Nonlinear stability conditions of the equilibrium attitude are obtained in a modified energy-Casimir method. The nonlinear attitude stability is then investigated versus three parameters of the asteroid, including the ratio of the mean radius to the orbital radius, the harmonic coefficients C20 and C22. We find that when the spacecraft is located on the intermediate-moment principal axis of the asteroid, the nonlinear stability domain can be totally different from the classical Lagrange region on a circular orbit in a central gravity field. With the Lie group framework uncovered by geometric mechanics, besides determination of the equilibrium from a global point of view and the energy-Casimir method for nonlinear stability, several other powerful techniques can be performed, such as the variational integrators for greater accuracy in the numerical simulation and the geometric control theory for control problems.