Motivation for getting good grades in graduate school
You are confusing cause and effect.  Good grades should never be a motivation for a truly good student (in graduate school or elsewhere).  Rather, good grades are a byproduct of engaging deeply with the material of a class.

When I was a graduate student, there were some classes that I was quite happy to get a B in, because they were far outside of my main area of work and taking them really stretched my mind; the B was a good reflection of the reality that I am not suited to be a theoretical mathematician, but that I had learned well from them regardless.  There were other classes that I would have been frankly ashamed to get anything other than an A in, because they were totally in my wheelhouse; if I had gotten even an A-, it would have reflected a real waste of my opportunity in that class.

In short: forget about grades in graduate school, except insofar as they are feedback on whether you are screwing up your education.