I believe it can be used in the active voice as well as the passive voice, as in "Swear allegiance to one's country". In fact, I think all verbs can either be used in the passive or active voice.
Swear can be used as both an intransitive verb, where it does not have a direct object receiving the action, as in "I swear", and a transitive verb, as in "I swear allegiance to...". There are also some phrasal verbs such as below, taken from the free dictionary online. In your example, "swear in" is a phrasal verb in the active voice and "was sworn in" is the passive voice.
To use vulgar language against; curse:
1. To have great reliance on or confidence in: He swears by his personal physician.
2. To have reliable knowledge of; be sure of: I think she left early, but I couldn't swear by it.
3. To take an oath by: He swore by all the angels and saints of heaven.
To administer a legal or official oath to: swear in a mayor.
swear off Informal
To pledge to renounce or give up: She has sworn off cigarettes.
swear out Law
1. To attest to (an affidavit or complaint) by oath.
2. To swear to evidence under oath in order to obtain (a warrant for arrest).