Is there a word for when people secretly want to fail at something they're doing?
Tanking is a common term in sports to refer to purposefully losing.
Tanking ... the act of giving up a match or "throwing it away", losing intentionally or not competing. (Urban Dictionary)
e.g. They tanked their match because they got angry with the umpire.
This practice is common in the NFL and other professional sports where losing more often means you'll be able to get a better draft position in the following year. Professional sports leagues benefit from parity so leagues like to give certain advantages to poor teams and disadvantages to successfully teams in hopes that no one team does terribly for long periods of time.
Just last month, an ESPN sportswriter posted an article about the advantages and disadvantages of tanking, A tanking guide to the NFL, and a warning
There is a certain stigma attached to purposefully losing so most teams won't admit the practice, but it is nonetheless common because of the big advantage it can give to the franchise.
You could also call it feigning incompetence.
Here is an article about what to do when kids try to do it: How do you handle feigned incompetence in your children.
Mom: Can you please wash the dishes for me?
Child: Oops! I dropped another dish. I don't think I can handle this, Mom!
In your first two examples, there's merely a desire for failure. In the third example, the subject takes action.
For third case, you can use a word like undermine or sabotage.