You're comparing apples to oranges. Your choice of whether to use the passive voice is not a choice that relates to tense. You don't make a choice between a voice and a tense; you make a choice between two voices, or between two tenses.
The choice of voices is between active and passive. In general, the active voice is more direct and powerful, and aligns the reader with the subject of the sentence. ("He wrote the book" draws attention to the person who wrote the book, more than to the book.) The passive voice, on the other hand, is softer, and more languid, and places the emphasis on the object of the verb rather than the subject. ("The book was written by him" places the reader's attention on the book, rather than on the author.)
In your examples, the first one indicates a completed action (he's through writing the book), whereas the second indicates something that was going on in the past and is possibly still going on now or at least was going on fairly recently. So it's simple: Choose your tense based on whether the action is done, or more continuous in nature.