As clarification on Proto Man's invincibility, he's probably not invincible, but leaves after you hit him 24 times. (Less in the final battle against him, I think, also less if you use a special weapon, but I don't think special weapons work the last time you fight him) This would indicate he has the standard 28-point life bar, and that he runs away as you are about to finish him.
In MM5 Proto Man isn't the villian, a look-alike robot is.
In MM7, you fight both Bass and Proto Man. Proto Man does it just to see "which of us father made stronger", while Bass shoots at you the 1st time he sees you. Afterwards he remarks (if you win) that "You are as strong as they say". It would appear fighting each other to determine relative strength is a common android greeting. Mega Man isn't trying to slaughter other robots, he's just overly friendly! Proto Man fought as a way of getting to know his brother!