I wonder is it a good idea to ask for a letter of recommendation from a emeritus professor who I took his course and knows me well?
I was wondering is it bad to get a letter from someone who is not in Academia anymore?
The best reference is the one that is both honest and based on extensive firsthand knowledge of your qualities. Emeritus status would seem irrelevant to me.
I think the answer to your question hugely depends on your application and resume.
If you are having advisers who are writing you strong letters of recommendation (for instance, your masters thesis advisers or professors you have worked in their research group and have publications with them), then you will probably do not need a letter from a professor with whom you'd only passed a course.
On the other hand, if you have not worked with a professor, probably your advisers of your thesis, then you really need a letter of recommendation from a professor that knows you and you had passed his course. So that emeritus professor can write a good letter of recommendation for you. Of course, it is better that nothing.
To the best of my knowledge, students usually need two or three letters of recommendation for their PhD applications.