Oxygen is more electronegative than sulfur. This means that the oxygen atom in furan attracts electrons more strongly than the sulfur atom in thiophene. As a result, the lone pair of electrons on the oxygen atom in furan is held more tightly and is less available for interaction with a proton. This makes furan less basic than thiophene.
Another way to look at it is to consider the resonance structures of furan and thiophene. In furan, the lone pair of electrons on the oxygen atom can delocalize into the pi system of the ring, forming a resonance structure with a positive charge on the oxygen atom. This resonance structure contributes to the overall stability of furan and makes it less reactive towards protonation.
In the case of thiophene, the lone pair of electrons on the sulfur atom is less able to delocalize into the pi system of the ring due to the larger size of the sulfur atom and its weaker electronegativity. This means that there is less resonance stabilization in thiophene, making it more reactive towards protonation and hence more basic than furan.
In summary, the lower electronegativity of sulfur compared to oxygen results in a weaker attraction between sulfur and the lone pair of electrons, making thiophene more basic than furan.