What is wrong with my Genetic Algorithm?
your algorithm is not a genetic algorithm, it is a simple model of infection.

genetic algorithm normally uses at least the following concepts: inheritance, mutation, selection (or fitness).
see, e.g. here

if - for the sake of introductory understanding - you want to apply these concepts to your example:  


inheritance:
conceptual: you need a genetic identity of your unit (the animal).
code: i.e. you need animals with state, different instances.
how: each animal inherits this genetic identity to the next generation when it is reproduced.
mutation:
conceptual: each generation is slightly different from the other.
code: each animal in a new generation has slightly different values than its parent.
how: apply some random modification.  
selection of fitness:
conceptual: you select which units are reproduced for the next generation by the differences between the units. choose the fittest.
code: when assembling the new generation, choose only those units for reproduction that satisfy a certain fitness limit (e.g. the best 90%).
how: define a fitness-function which returns a value indicating relative fitness for each unit.


to put it together, you could make e.g. different herds of animals that have different starting values for the 'genetic' attributes (e.g. preferred_proximity_to_next_animal, skin_color, height, aggressiveness, etc
.).
Then, in your fitness function, you define how each of the attributes is connected to fitness, i.e. how they are related to the probability to get infected. then let the program run for a some of generations and see how at each iteration the global probability of infection decrease in relation to the genetic setup of your herd.  

Like that you might find favourable combinations of attributes.
Generally, genetic algorithms are used in search-related problems.