We know that in spherical coordinates angle $\theta$ and $\phi$ (two angles)are enough to express three dimensional rotation of matrix. But to express rotation mathematically as a transformation matrix we require three angles. But intuitively I expect only two parameters for rotation matrix based on the knowledge of spherical coordinates. What is wrong here?
As pointed out by lemon, two angles are enough to specify a direction in a three dimensional coordinate system, but another is needed to specify a complete coordinate transformation. You can think of a rotation transformation in three dimensions as a mapping between two different coordinate systems. Two angles are needed to specify the relative pointing between the two z axes, but another is needed to specify the relative pointing of the x axis. Without this third angle the x and y axes could lie anywhere in the plane perpendicular to the new z axis.