Dynamics of generalized Palatini theories of gravity