Predicting positive or negative reinforcement from environmental clues is essential to guide decision making and goal-directed behavior. In insect brains the mushroom body is a central structure for learning such valuable associations between sensory signals and reinforcement. We propose a biologically realistic spiking network model of the Drosophila larval olfactory pathway for the association of odors and reinforcement to bias behavior towards either approach or avoidance. We demonstrate that prediction error coding through integration of present and expected reinforcement in dopaminergic neurons can serve as a driving force in learning that can, combined with synaptic homeostasis, account for the experimentally observed features of acquisition and extinction of associations that depend on the intensity of odor and reward, as well as temporal features of the odor/reward pairing. To allow for a direct comparison of our simulation results with behavioral data we model learning-induced plasticity over the full time course of behavioral experiments and simulate locomotion of individual larvae towards or away from odor sources in a virtual environment.