What is the meaning of [While you live, tell truth and shame the Devil!]

Tell the truth, even when tempted to lie.
The preacher Hugh Latimer recorded this as a ‘common saying’ as early as 1555, in his Twenty Seven Sermons:

“There is a common saying amongst vs, Say the truthe and shame the diuel.”