Hi
A few comments to your question...
Traditionally, ESL students have been taught passive tense by adding "by" to an agent in the sentence.
This rule can be misleading, or at least proved confusing to some learners.
Not all verbs and sentence are passive compatible, at least idiomaically.
For instance:
John tripped over his pants and fell down the stairs.
In your passive sentence, "home work was done by Joe" is grammatically correct but you wouldn't catch a native saying it that way. Passive voice is used when an agent is not essential to the sentence, or in situations where agent is intentionally omitted, in other words, not all passive sentences would include an agent.
i.e. Active: Mary cleans her house every week - this focuses on the subject, Mary, who does the cleaning.
Passive: Mary,s house is cleaned every week- this focuses on the object, her house, which could be cleaned by her or a mate but the agent is hidden. The main point is that "the house is cleaned", not who cleaned it.