The author appears to be saying that the question of whether loyalty is good or bad (virtuous) depends on how far the individual is willing to go for this principle (extent) and what/who the individual is demonstrating their loyalty to (object).
I'm guessing the question then comes down to whether the object of one's loyalty is itself 'virtuous', and whether said loyalty might drive one to perform acts that are in themselves 'not virtuous'.
Keep in mind that the use of the term 'virtuous' places all judgments based on this statement in highly subjective territory, so I would be cautious with those examples as you've provided them. Why should a soldier's loyalty to their country, for instance, be regarded as inherently virtuous? This depends on whether the country is virtuous, and there's not a country in the world today for which you could not find vastly differing opinions as to the status of said nation's 'virtue'.