The simple answer is that they weren't silent at some point in the past, and spelling didn't change as quickly as pronunciation.
French spelling is based on old French pronunciation. When the spelling of, e.g., veulent (Latin volunt) was fossilized around 1100-1200, we can see that the vowels were no longer pronounced as o and e were during that time period and were thus changed. The consonants remained the same. Now, despite the fact the nt isn't pronounced, we know it was in the Latin and can confidently guess it was in Old French.
You could try asking /r/linguistics too.
It's the right sub to post it, because it's an HISTORICAL fact.
Basically languages evolve at a faster pace than official grammars do. Academically we refer to the phenomenon you're asking about as "grafia storica" in Italian. I am really sorry, but I am not able to find a suitable translation over the internet right now for it.
How does it work? Let's take English. If you are not native speaker (as me) the first thing you notice is that sometimes there is no clear correspondence between spelling and pronunciation. That's why you need to "spell" things (and I guess you have contests for kids about it, as far as I got from The Simpsons, but I digress) sometimes.
"Borough" for example has many silent letters. But you can find thousands of instances, and not only in English. You point out French, which is a good example, for instance when looking at d-p-s-t as ending letters, as they do not translate into spoken phonemes. In Persian we write خو (transliterated KH-W) but we only read خ (KH).
Why is it so, then? The reason is pretty simple usually: we used to read them as they were written. When a spoken dialect became an official language with a standard written system, the words were categorized and written (more or less) as they were heard. Then they became TAUGHT in that way for different centuries. But languages flow, and change. So does pronunciation, like in the Great Vowel Shift. But usually written language is less receptive to these changes, as they are often understood in pejorative terms from the "old norm". And so it happened in French: the silent letters were pronounced, then they became standard written in that way, then the letters became silent and they are still standardly written with them.
Hope this makes sense!
The Académie Française has met several times to ask this question. Simply put, silent letters were kept, despite not being pronounced, to show the etymology and word history. You can think of our English work 'knee' which used to be pronounced WITH the /k/ sound. Compare this with the Monty Python word, 'ni.' I am sure you can see the interest in keeping some history in spelling. Spanish as a counter-example has perfectly phonetic spelling, all ancient pronunciations were simply discarded.
Beyond the explanations already given, I'd also like to point out that technically, what we consider a "silent letter" is based on our bias of how we think letters should be interpreted to sound. It is necessary to recognize that the correspondences between sound and letter are arbitrary in many ways, and dependent on context. Think how many English words we do not consider to have a "silent" letter, when in fact, if we took every letter at face value, we would find that they do-- for instance, when was the last time you pronounced the first "a" in "parade" the way you normally think an "a" should be pronounced? (Assuming you speak some sort of 21st century American English)
My point is, letters only seem "silent" when you take them at a prescribed face-value.
Instead, consider the letters of a word in its whole, in context: "l'état" is made of 5 letters that, in that order, produce the sound (rendered in English colloquial spelling) "leh-tah". None of the letters in l'état are silent-- for their combination triggers the intended pronunciation, which is all any written word does.
Saying that French has a lot of silent letters implies that the words are somehow incomplete or that there are sounds that are not being said. This is not true-- in fact, all the letters of every French word contribute to the sound that a reader makes when he/she reads it.
Every language changes. Always. And people tend to shorten words when speaking (going to -> gonna is just one example).
When the french language began to develop, it moved away from latin. However, during the renaissance, people were resiscovering the old texts and philosophers and the authorities decided that, in order to get closer to their classic ideals of language, the spelling of words should be adjusted. They tried to reintroduce latin words.
At the time, people did not understand yet that spoken language can not be changed artificially while written language can be changed in order to make it drift away from what it is representing.
Eventually, the difference between spoken and written language led to latin becoming a "dead" language and some experts today are sure that the french spelling will eventually need to be heavily reformed in order to make it less complicated.
P.S.: Sorry for the bad English