For most languages, fully phonetic is not that much of a sensible goal. In general, languages aren’t understood in phonetic but rather in phonemic terms. The set of phonemes of a language is the collection of sounds that a speaker would usually differentiate as different sounds. For example, the first sounds in Kate and gate would be differentiated by speakers of English and identified as (voiceless) /k/ and (voiced) /g/ respectively. On the other hand, speakers of English would rarely identify the /k/ sound in Kate and skate as different although the former is typically aspirated while the latter is typically not aspirated, meaning that they would be written slightly differently in a fully phonetic alphabet. (Other languages do distinguish aspirated from non-aspirated plosives so speakers of those would probably identify the two /k/ sounds as different.)
When considering phonemic writing systems rather than phonetic ones, we find that many languages do a very good job at it. Dominik has listed Italian and Slovene, I would like to add Finnish to the list of an almost fully phonemic writing system.
If you look into history and at newly invented scripts, these were often phonemic when they were first used. However, then and now other languages (and cultures) would copy the scripts already in use by their neighbours and adapt them to their own language which often had a different phoneme inventory – especially if the two languages belonged to different families. There were then two options for the copying culture: leave it as is and find workarounds for stuff that did not really work out or invent one’s own script based on the neighbour’s script (including strongly modifying the neighbour’s script to one’s own requirements). Both occurred frequently but the latter tended to result in a new, phonemic writing system more often than not.
If you look at the history of the Latin alphabet, there were many precursors but I will start at Phoenician. This script was adapted to the Semitic language that is Phoenician meaning it had two different letters representing the two s-like sounds and two for the two t-like sounds; in addition, it distinguished between /k/ and /q/. On the other hand, they had no vowel symbols. The Greeks found this writing system useful and copied it, but Indo-European languages like Greek have more necessity for distinguishing vowels than Semitic languages do; on the flipside, Greek had far less use for some of these letters that represented identical (to Greek ears) sounds. Thus, signs were reassigned, vowel signs created and some symbols (like the one for /q/) fell out of use as there was no need for them.
The Early Greek script was copied by the Etruscans who spoke a language that was likely not Indo-European. Again, there was some re-assignment, some double-representations (Etruscan, for example, apparently did not differentiate [g] and [k]) and some sounds lacking. This Etruscan alphabet was then again adopted by a new culture whose founding myth involved a boy raised by a wolf killing his brother. Once again, there were reassignments, new inventions and a bit of this-and-that before this culture had a mostly phonemic alphabet and proceeded to conquer most of Europe, North Africa and the Middle East. And there we are, the Latin alphabet once rather phonemic but then passed on, handed down, across languages whose phonemes might or might not match it leading to some better and some worse adaptations.