You must move the reference frame to the origin because applying a rotation matrix results in a rotation about the world origin. Consider: if you have a ball 3 feet away from the origin. If you apply a rotation in world-space, the ball will orbit the origin at a distance of 3 feet. Not only has it been rotated, but it's also been translated - it's not longer in the position it was before the rotation. If you first move the ball to the origin and apply a rotation about the origin, the ball rotates but does not translate.
In your code, you start with the bone's bind pose matrix - it's position in world-space. That matrix is comprised of the parent's world-space matrix (bind pose) times the bone's local matrix. That is, the bind pose moves the bone into it's parent's space, then moves the bone to it's position and orientation with respect to its parent.
To apply a rotation, you first translate the bone to the origin, and when the rotation is applied, the bone is rotated about it's axis but is not translated. The resulting matrix is now:
You start with a matrix (you call it bind) = bone-bind-pose = parent-bind * bone-local.
If you then translate it to the origin and apply the rotation, the matrix that results is:
Equation A. bind = parent-bind * bone-local * translate-to-origin * rotation.
In the hierarchy, each bone's local transform is with respect to it's parent. This line of code:
mulMatrixByInverse(getJoint(joint.getParentIndex()), bind);
results in:
matrix = parent-inverse-bind * bind.
If you substitute the equation for bind given in Equation A in the matrix equation immediately above the result is:
bind = parent-inverse-bind * parent-bind * bone-local * translate-to-origin * rotation. Note the emphasis.
Any matrix multiplied by its inverse is the identity matrix. So, parent-inverse-bind * parent-bind = Identity-matrix, so:
bind = Identity-matrix * bone-local * translate-to-origin * rotation.
Multiplication of any matrix by the Identity matrix results in that same matrix - i.e., multiplication by the Identity matrix has no effect.
So, bind = bone-local * translate-to-origin * rotation, and that's the new desired local orientation of the bone. It's then stored as the local matrix for the bone.