There are several factors behind the deviation from Hardy Weinberg Principle.
Step-by-step explanation:
Hardy Weinberg tells us that the total frequency of the homozygotes and heterozygotes in a population is 1.

There are several causes of deviation to this principle. Some of them are:
A. Small population size - when the hardy weinberg principle is applied to a smaller population, the error becomes more in percentage, which seems to be a deviation from a population.
B. Bottleneck effect - any disease, disaster, habitat loss etc are responsible for the severe decrease in population which results in the deviation from Hardy Weinberg Principle.
C. Migration or immigration - migration of a huge part of population, or immigration of new genes from outside the population causes deviation from Hardy Weinberg Principle.
D. Evolution and mutation - both of these features cause the deviation.