I think the best way to translate that sentence would be:
Nunca un fracaso, siempre una lección
although another possible small variation could be:
Nunca fracaso, siempre lección
which would sound better especially in a conversation or spoken, rather than written maybe.
Spanish is a really colorful and expressive language and they use these kind of sentences quite a lot but they alos use idioms or regional sayings. If you want to know more about them, here's a nice list of common Spanish idioms you can use that will make you sound like a native and plus will let you know more about the language.
If you want more, here's a fuller list of Spanish sayings.
Hope this helps!