To classify any flow as Rotational or Irrotational the angular motion of the fluid elements is analyzed. If the angle between the two intersecting lines of the boundary of the fluid element changes while moving in the flow, then the flow is a Rotational Flow. But if the fluid element rotates as a whole and there is no change in angles between the boundary lines then the flow cannot be Rotational Flow, so it is Irrotational Flow.
This means that there should be some deformation in the fluid element in a Rotational Flow. Such deformation of the fluid element or the shear strain is necessarily caused by tangential forces or shear stresses. Shear stresses are caused by viscosity, thus the flow of viscous fluids is rotational. But this does not mean that the flow of non-viscous or ideal fluid is always irrotational. The flow of ideal fluids can be rotational by external work or heat interaction.