If our reps acted purely on the whims of the majority all would be confusion and masses of bad legislation would be the result.
Even in a Republic the representatives of the people are expected to vote to reflect the will of the people who put them there.
Is that not exactly why we have elections? to have the opportunity to vote for those who will go to Washington and represent our wishes?