I was wondering why these two letters (capital 'I' and lowercase 'L') look the same in some fonts? Is there any historical reason?
Each letter evolved from alphabets and symbols of previous languages. The letter I came from the Greek letter iota and the Phoenician yodh. The letter L traces back to lambda in Greek, and the Phoenician lamedh (evidently, some believe these ancestors of L may have been formed based on the shape of a shepherd's staff). You can read more about each letter's history on Wikipedia's pages (here are the links to I and L), and an excellent entry on homoglyphs can be found here. Many print dictionaries have even longer commentaries about the evolution of each letter.
In any case, I don't think the designers of the English alphabet said, "Let's put in two characters that look almost the same!" The letters just happened to evolve the way that they did from earlier alphabets.
Early typewriters sometimes took advantage of these similarities. Many early typewriters didn't even have a
1 key; the numerals started at "2", and typists used a lower-case
l to type a numerical "1".
Such similarities may have helped keep the manufacturing costs of a typewriter down low, but look-alike symbols became more problematic in the programming age, so many font designers today take care to keep each character looking distinct. Even o and O and 0 don't look exactly the same in this site's Ge0rgia [sic] font, and the monospaced font makes the zero character (
0) look even more unique.
In some sans-serif fonts they look almost the same and are difficult to tell apart. These glyphs can also be confused with the pipe character or the number one. This is especially so in a small font size. Also the capital letter "O" and the number zero can look deceivingly similar. A number of Microsoft products uses just such a font in a number of dialog boxes where you type some code, which is very frustrating, as you cannot change the font or size. When you resize such a font to about 20px you can tell those glyphs apart readily.