That's quite common. I think free-range poultry can quite successfully be integrated with solar panels, too.
But unfortunately, a lot of solar installations are going in in arable areas, so not only are they taking up prime agricultural land but there's not the livestock available to utilise the ground around and beneath the panels.
Either way, putting up a fence around private property, in order to help protect one's investment from trespassers, is a perfectly reasonable thing to do and not limited to solar farms.
Whether or not there should be solar panels at all is a totally different argument altogether, and has nothing to do with whether or not it's ok to fence private property to provide security.