Found this -
www.eurogroupforanimals.org/news/free-roaming-cats-sweden-should-now-be-neutered
'Free roaming cats in Sweden should from now on be neutered
2 June 2020
Djurens Rätt welcomes the decision of the Swedish Board of Agriculture to adjust the existing animal welfare law regarding pets. From June 15 cat owners will be obliged to ensure their cats do not reproduce unplanned.
Cats that move freely outdoors should be neutered, sterilized or in other ways prevented from reproducing uncontrollably.'
and
www.veterinary-practice.com/article/canine-neutering-legal-aspects
'In Sweden, castration was made exempt from the prohibition to remove body parts in 1988, hence neutering is allowed under the Swedish Animal Protection Act [djurskyddslagen (1988:534) §§10/11] and its regulations 1988:539.'
and in Norway, animals can be neutered for health reasons (preventing pyometra, preventing male behavioural issues, etc). There's also law relating to breeding of dogs that inherently have health issues, such as brachycephalic dogs, so it would be legal to neuter a dog with those characteristics to prevent them being passed on to future puppies.
'Breeding shall encourage characteristics which give robust animals which function well and have good health.
Reproduction, including through methods of gene technology, shall not be carried out in such a way that it:
changes genes in such a way that they influence the animals’ physical or mental functions in a negative way, or passes on such genes,
reduces the animals’ ability to practise natural behaviour, or
cause general ethical reactions.
Animals with a genetic constitution as cited in the second article shall not be used for subsequent breeding.'
So no, it's not illegal to neuter animals in Norway.