This is a subject discussed in a new article by Justin Marquis, Teaching Students to Fail Their Way to Success. In education the emphasis is more on the end result (exam, test, assessment) than the process and the stakes are high. A failure doesn't automatically give you a new life and can often lead to the pupil/student giving up the course completely.
"With a focus on testing, competencies, and teacher accountability in education, the focus is taken off of playing the game (learning) and put on finishing it (outcomes). While standards, standardized tests, or marketable skills (in higher education), are part of our educational reality, they do not need to be the focus of your teaching. Whenever possible, given the constraints of a schedule, give students the opportunity to work at their own pace towards clear learning objectives."
Failure is part of the learning process; you'll never learn to skate without falling over a lot. In gaming failure is treated as a natural element and each failure can lead to success next time. That element keeps us involved and small "failures" are motivators to try again rather than demotivators. The key in education is to focus on the process of learning rather than the result of it.
"We live in a connected world where "knowing" something is much less important than knowing how to find information and apply it. Part of that process is understanding how to respond to failure when things don’t work out. Adjusting your instructional objectives to help students understand that learning is a process of which failure is a key ingredient will help them to be successful when there are no more tests to take and failure is not an option."