How do teachers learn to grade?
One principle is that the instructor should aspire to grade in a way that results in the grade being most closely correlated with those aspects of the knowledge and skills being assessed that the instructor considers important.

As an example, it is a common belief among instructors of university level mathematics courses that exam questions should test conceptual knowledge rather than facility with arithmetic and other low-level calculations. For this reason, most instructors would take off only a very small number of points, or not take off any points, for a small error of arithmetic in an otherwise conceptually correct answer. However, some instructors might consider accuracy to be an important skill to test in and of itself, and may impose a heavy penalty of points for even small arithmetic errors. So you see, the grading function chosen by the instructor reflects that instructor's view of what's important. Decide in advance what's important to you, and grade accordingly.