As the title reads , when you right click an allied unit your hero will just move to it and follow it around without attacking.
The way it should work would be (if you have auto attack turned on) for your hero to move to that creep and then attack the nearest enemy creep within acquisition range.