There is no such law although there is a Bill currently before Parliament. (However it's got many hurdles to cross if it's ever to become law). See
https://thenegotiator.co.uk/pets-bill-rosindell/
and
https://services.parliament.uk/bills/2019-21/dogsanddomesticanimalsaccommodationandprotection.html
There is therefore currently no requirement upon private landlords to take pets. The "Homelessness code of guidance for local authorities" states:
"17.63 Housing authorities will need to be sensitive to the importance of pets to some applicants, particularly elderly people and rough sleepers who may rely on pets for companionship. Although it will not always be possible to make provision for pets, the Secretary of State recommends that housing authorities give careful consideration to this aspect when making provision for applicants who wish to retain their pet".
The CAB's advice regarding pets in rented properties can be found here:
https://www.citizensadvice.org.uk/scotland/housing/renting-a-home-s/problems-during-a-tenancy/pets-and-service-animals-in-rented-homes
As an aside, I'll mention that my friend moved into a brand new housing association bungalow a couple of years ago. It's semi-detached, with the bungalow next door to it being virtually identical except for the fact that it's been adapted for use by a disabled person. The housing associations tenancy rules permit my friend to have pets but it prohibits their next door neighbour from doing so, which I see as discrimination against disabled people!