Recurrent networks endowed with structural priors explain suboptimal animal behavior