At the time of the novel's publication in 1896, there was growing discussion in Europe of the possibility of the degeneration of the human race. Increasing opposition to animal vivisection led to formation of groups like the National Anti-Vivisection Society in 1875, and the British Union for the Abolition of Vivisection in 1898.[9] The Island of Dr. Moreau reflects the ethical, philosophical, and scientific concerns and controversies raised by these themes and the ideas of Darwinian evolution which were so disrupting to social norms in the late 1800s.
In his preface to The Works of H.G. Wells, Volume 2, The Atlantic Edition (1924), Wells explains that The Island of Dr. Moreau was inspired by the trial of Oscar Wilde.
"The Island of Doctor Moreau" was written in 1895, and it was begun while "The Wonderful Visit" was still in hand. It is a theological grotesque, and the influence of Swift is very apparent in it. There was a scandalous trial about that time, the graceless and pitiful downfall of a man of genius, and this story was the response of an imaginative mind to the reminder that humanity is but animal rough-hewn to a reasonable shape and in perpetual internal conflict between instinct and injunction. This story embodies this ideal, but apart from this embodiment it has no allegorical quality. It is written just to give the utmost possible vividness to that conception of men as hewn and confused and tormented beasts. When the reader comes to read the writings upon history in this collection, he will find the same idea of man as a re-shaped animal no longer in flaming caricature, but as a weighed and settled conviction.
— https://en.m.wikisource.org/wiki/The_Works_of_H._G._Wells_(Atlantic_Edition)/Preface_to_Volume_2