The question of why do we have craving In Buddhism everything boils down to we as humans and animals crave. Craving is the root cause for suffering and rebirth.

So the question becomes why are we hard coded to crave. Is there any reference in Buddhist documents where the Buddha have answered this question?

Personally i think every living being is hard wired to crave because of survival. I think at a primal level for every living being the main objective is to survive and to reproduce and i think that is why we have craving and all those akusala karma such as jealously anger etc...

please tell me you opinions or any reference in Buddhist scriptures
The Puttamansa Sutta lists four nutriments for the sustenance of beings (sattānaṃ) who have come to be (bhūtānaṃ) and for the support of beings seeking to be (sambhavesīnaṃ), namely:


Edible food, coarse and fine; 
Sense-impression;
Volitional thought; and
Consciousness.


For unenlightened beings, craving is included within the nutriment of volitional thought, as stated: 


  If the nutriment volitional thought is comprehended, the three kinds of craving are thereby comprehended.
  
  Puttamansa Sutta


Thus, at a primal level, for every unenlightened living being, craving serves the main objective (of nature) to survive and to reproduce.

As for the enlightened, they survive more skilfully relying on wisdom rather than craving. 



The word 'dharma' means 'that which supports' thus craving also supports life but it is an 'akusala dhamma', namely, an unskilful means of support. For example, the suttas state:


  Thus, Ānanda, in dependence upon feeling there is craving; in dependence upon craving there is pursuit; in dependence upon pursuit
  there is gain; in dependence upon gain there is decision-making; in
  dependence upon decision-making there is desire and lust; in
  dependence upon desire and lust there is attachment; in dependence
  upon attachment there is possessiveness; in dependence upon
  possessiveness there is stinginess; in dependence upon stinginess
  there is safeguarding; and because of safeguarding, various evil
  unwholesome phenomena originate—the taking up of clubs and weapons,
  conflicts, quarrels, and disputes, insulting speech, slander and
  falsehoods. Therefore, Ānanda, this craving is the cause, source, origin, and condition for those various evil unwholesome phenomena.




To add, "we" do not crave. To the contrary, it is craving that creates the idea of "we". To quote: 


  "Who, O Lord, craves?"
  
  "The question is not correct," said the Exalted One. "I do not say that 'he craves.' Had I said so, then the question 'Who craves?' would
  be appropriate. But since I did not speak thus, the correct way to ask
  the question will be 'What is the condition of craving?' And to that
  the correct reply is: 'Feeling is the condition of craving and craving
  is the condition of clinging.'"
  
  SN 12.12
  
  
  
  An uninstructed, run-of-the-mill person assumes form, feeling, perception, fabrication &amp;/or conscious to be a self. That assumption
  is a fabrication. Now what is the cause, what is the origination, what
  is the birth, what is the coming-into-existence of that fabrication?
  To an uninstructed, run-of-the-mill person, touched by that which is
  felt born of contact with ignorance, craving arises. That fabrication [of self]
  is born of that.
  
  SN 22.81