From a dictionary: "Persisting in or remaining constant to a purpose, idea or task in spite of obstacles." Notice it doesn't start, "Wisely persisting..." Perseverance can clearly be both a good thing and a bad thing. Remember that when you find yourself wanting to quit something. Quitting might be the wisest choice.
Of course, the problem with the idea that you should quit when something isn't worth the effort, is that it's often used as a rationalization. It comes to mind when the effort is difficult, but really is worthwhile. It's confusing at times, so how do you wisely persevere?