When I am not productive I feel really sad? Why do I want to take even a bad job?

Gratitude. Sadness is a sign you have not accepted where you are - replace this with gratitude for being given a challenge you can work with. Sadness is victim thinking serves no purpose and drains you. Gratitude is a choice thinking - life is about choice so set goals you can work on. I do a exercise if I am sad. (taught by sri srravishankar) sniff out sadness -sniff twice -http://www.Artofliving.Org.
Some people . . . I don't know whether this describes you or not, but some people equate personal worth/loveablity with work status, career prestige, income, etc. Such people can feel worthless/bad if not working, so they take the first job offered -- even if it's a "bad job". Taking such a job temporarily may be needed to pay bills, keep your home, etc -- but if so, you can still look & work. Good luck to you!