A Google search for ugly of walruses yields many results mentioning the word as an item of trivia.
But I've yet to discover a single source actually using the word.
Did it in fact ever have that meaning?
Would you trust a dictionary to count it as a "ever a word"?
The Chambers Dictionary 12th Edition lists it in is back material under the heading "50 wonderful collective nouns".
Though they do themselves note it as one of the more fanciful sections:
Here are some of the most evocative collective nouns which have been coined for animals and birds. We think that these are guaranteed to stir the imagination.
Chambers is a strange dictionary in some ways (most dictionaries would not define an eclair as "a cake, long in shape but short in duration") but they would not be likely to list it unless some previous use was attested.
Terms of venery are strange beasts (excuse the pun) as senses of words go.
Humour has always been part of their coining when you consider such early examples as "a doctrine of doctors" and "a disworship of Scots", both cited in 1486, and as I argued in a recent answer on a question about another such term, a big part of the point of such terms is just to learn them for the pleasure of having such pointless knowledge.
The etymology is almost always a matter of someone associating a quality with the animal in question, and presumably someone found walruses to be ugly.
A great exception to this is surfeit; "surfeit of skunks" presumably because any number of skunks could be considered more than necessary, but "surfeit of lampreys" is a reference to the reported cause of death of King Henry I of England, viz. "a surfeit of lampreys".
To people whose understanding of medicine does not revolve around the doctrine of the four humours (by which understanding lampreys are extremely phlegmatic—cold and wet—and so dangerous to an already phlegmatic person) this cause of death seems unlikely, but in any case that is the cause of death known to history, and someone turned it into a collective noun.
And as such, people make these things up all the time. I made up "click of web developers" as I was giving that previous answer. I know of one example that is listed in a dictionary that was invented by a group of people who wanted to see if they could manage to get an invented term of venery listed in a dictionary (I'm not saying which it is*, but it wasn't "ugly of walruses").
So really, it's a matter of where you want to draw the line. That there is one reasonably respected dictionary that doesn't just specialise in such terms but which does mention it is as good a reason for saying "okay sure, it's a 'real' meaning" as any other, but that most dictionaries don't list it as a meaning under ugly is as good a reason for saying "nope, it's not a 'real' meaning" as any other too.
Was ugly ever a word meaning a group of walruses? Yes.
Is ugly now a word meaning a group of walruses? Might as well ask what the collective noun for angels dancing on the head of a pin is.
Is it a good idea to use ugly in such a sense? Probably not, it won't be widely understood compared to herd or pod, but then if you're one of the people who enjoys obscure terms of venery (and you won't be alone) then don't let that stop you.
*Taking a look, I see that a feature of the definition of this invented collective noun was "corrected" from a slangy abbreviation to a more normal form, and it has made its way into several works, including printed dictionaries of collective terms, posters about the thing in question, and so on. You really can just make these terms up for the fun of it and have it accepted.