Riker was just being a jerk to Ro, that was it. It had nothing to do with violating Starfleet regulations or anything.
Exactly. Had Ro not been wearing that earring, Riker would have torn her a new one about her "non-regulation hairdo" or "slouching posture unbecoming of an officer" or "failure to properly address a senior officer when coming aboard". The regulations would exist, in theory, but Riker would never have enforced them if it had not been Ro Laren specifically who was standing where he didn't want her to stand - that is, within fifty lightyears of him.