Twenty-one of those men would use z těch mužů I think. That would be a partitive use of the genitive. Larger numbers use a genitive of content where the number is referred to as a collection and the counted thing is in the genitive describing the contents, as in "a flock of birds". One could write a construction like this in archaic English "The score and one of those men did I know."
Muž isn't the direct object. The direct object is the collection of twenty one, and it's a collection made up of those men. The word order makes it even trickier to understand. Ten becomes těch to agree with mužů, and it is at the start of the phrase because it's a demonstrative. Compare with the English "those dozen eggs".
The second place rule applies here too, however, it does not always have to be the second word. In this sentence, the subject is in the first place (mužů), but it's developed so all the words that develop it will stick to the subject and are considered to be in the first place too. I don't know if this is the correct word in English, but clitics are the second element in a sentence.