I have noticed that all the Romance languages (Spanish, Galician, Catalan, Portuguese, Italian, Romanian, and French) usually pronounce the "ll" like the "y" in "yacht". This feature is called "yeísmo"." Each of these languages also use other sounds for "ll" like the "j" in "jam", like the "sh" in "ship", like the "s" in "measure", like the "th" in "thin", or like the "th" in "this". What is the historical origin of these special pronunciations for "ll" in the Romance languages?
As mentioned, you’re overgeneralizing somewhat. For example, standard Italian does not use “ll” to spell a “y” sound.
"yeísmo" is the merger of the “ll” and “y” sounds in Spanish. Before this sound change, “ll” in Spanish was pronounced as a “palatal lateral approximant” consonant sound. The change to the non-lateral palatal approximant /j/, or some other kind of non-lateral palatal sound (such as a fricative or affricate), can be described as a loss of the “lateral” feature. You might be able to find attempted phonetic explanations of this sound change if you search using some of these terms.
The historical origin of special pronunciations for "ll" goes back to Latin. Latin grammarians describe multiple pronunciations (what modern linguists would call “allophones”) of the Latin /l/ sound, and geminate or long ll had a distinct quality from single l when surrounded by certain vowel sounds.
As the answer by @sumeluc points out, the reason why some sounds may merge or replace each other is the similarity of their articulation. One could further speculate that double consonants appear at the syllable boundaries: the first "l" of the "ll" belongs to the previous syllable, whereas the second begins the next. Shifting of stress may lead to syllables merging - as, e.g , in French where the final syllable is often not pronounced, leaving its first consonant as the part of the preceeding syllable: belle, sonette.
How and when it happens historically is a matter of language history. That several related languages share this feature may mean that either it had emerged before the languages diverged from their mother language, or that they evolved under similar influences (e.g., the similar native languages of the peoples who were learning Latin in our case).
As I noted in the comments, in French the pronunciation of "ll" as "y" appears only when preceeded by "i" (i.e. "ill" ) and the consonant is not necessarily doubled (although this is usually in the final position, and doubling may emerge in other forms of this word: travail - travailler). In Spanish ll-as-y is the standard pronunciation. Finally, in Italian it is typically a part of "gli" sound: pagliacci. I can't say about other romance languages.
Disclaimer: I am not a linguist, so I would welcome suggestions from specialists for improving this answer (more than their downvotes).