The direct and indirect object pronoun in the first person plural is nos, obviously related to nosotros. Why is, then, the second person plural os, since vos would make more sense in order to correspond with vosotros? (I know that vos is used in certain dialects of Spanish, but it is not used as the direct or indirect object pronoun.)
The pronoun os developed during the Middle Ages as a shorter form of vos to be used after verb conjugations which ended in a consonant. This often meant the imperative, ending in -d. It first appears like this in writings of the 13th century.
The cluster -dv- (phonetically [db]) was (and is) very unusual in Spanish, so the speakers first simplified it by dropping the -v- and then began generalizing this form to all positions. By the 16th century vos as the object pronoun had almost disappeared.