In defining the reality of Imamat, it was made clear that a person may become a prophet or a messenger while he has not been appointed as an Imam. this position dem ands special eligibility in all aspects. it is the same position that Abraham (a.s.) attained after successfully passing many difficult tests and proving his genuine worthiness; this being the last step of his development to qualify for that rank.
Some may imagine that the qualifications of an Imam is only that a person ' be worthy and a model '. they do not consider the fact that this condition existed in Abraham from the very beginning of his prophethood. furthermore, not only Abraham, but also all prophets and messengers, had had this epithet from the onset of their calling. it is for this reason that a prophet should be sinless since his deeds are considered as models. therefore, Abraham (a.s.), who was a prophet and messenger of Allah, was gifted the rank of Imamat by Allah after he passed his trials successfully and proved that he was worthy of it.
source : http://www.maaref-foundation.com