In this paper we present a method to obtain deformations of families of matrixvalued orthogonal polynomials that are associated to the representation theory of compact Gelfand pairs. These polynomials have the Sturm-Liouville property in the sense that they are simultaneous eigenfunctions of a symmetric second order differential operator and we deform this operator accordingly so that the deformed families also have the Sturm-Liouville property. Our strategy is to deform the system of spherical functions that is related to the matrix-valued orthogonal polynomials and then check that the polynomial structure is respected by the deformation. Crucial in these considerations is the full spherical function Ψ 0 , which relates the spherical functions to the polynomials. We prove an explicit formula for Ψ 0 in terms of Krawtchouk polynomials for the Gelfand pair (SU(2) × SU(2), diag(SU(2))). For the matrix-valued orthogonal polynomials associated to this pair, a deformation was already available by different methods and we show that our method gives same results using explicit knowledge of Ψ 0 .Furthermore we apply our method to some of the examples of size 2 × 2 for more general Gelfand pairs. We prove that the families related to the groups SU(n) are deformations of one another. On the other hand, the families associated to the symplectic groups Sp(n) give rise to a new family with an extra free parameter.