I've read that some people attribute it to influence from the Slavic languages. But it doesn't just appear in Slavic loans — it also shows up in obviously Latin-derived words like câine 'dog' (from CANEM). On the other hand, not all words with a in Latin have â in Romanian — e.g. FRATER went to frate rather than *frâte. So was this a sporadic sound change, or a regular change conditioned by some environment, or what?
wrt. the other answer:
Romanian sfânt does NOT come from Latin sanctum, but from Slavic svętъ (compare with Polish święty); most Romanian (and Hungarian) Slavic borrowings turned the nasal vowels (which were de-nasalized in most Slavic languages) into vowel + n (vz. luncă, rând, mândru, muncă, smântână, etc).
Romanian /ɨ/ may also come from any vowel + /n/ , not just /a/; off the top of my head: /e/ (pavimentum -> pământ, tener -> tânăr, fenum -> fân), /u/ (aduncus -> adânc). Neither of those are later loans.
The same process from 2) also happened extensively with borrowings from other languages (e.g. gond -> gând).
Taken all together, it may be probable that the /ɨ/ (which btw, sounds more like /ɯ/ with most speakers) evolved by merging a series of nasal vowels that existed at some point in time; a hint in that direction is that /ɨ/ was written with Cyrillic ѫ in the old Romanian alphabet (the letter used for ǫ /õ/ in Church Slavonic).
Once established, the /ɨ/ became an euphonic alternative for almost any vowel, depending on the consonants surrounding it.
 I'm pretty sure that it also happened with vowel + /r/, though I cannot think of any example right now ;-)
In words of Latin origin, Romanian /ɨ/ arises from a few different places:
- Latin /a/ followed by /n/: cânt < canto, sfânt < sanctum. The diphthong in pâine, câine is due to assimilation to the following vowel.
- The Latin word /in/. This is not a regular sound change in that not all Latin instances of /i/ followed by /n/ are centralized, but all forms of the preposition "in" have /ɨ/.
- The vowel /i/ preceded by /rr/ or initial /r/: râu < rivum, urî < horrire.
Other instances of /ɨ/ are generally loans. Also, there are numerous words of Latin origin which appear to violate the rules above, but these are usually later reborrowings from Latin or sometimes French.