I second deceze's comment on your question. Der (nominative, masc.) and der (dative, fem.) are just homophones that are the result of the declination of the article.
German definite articles grew out of the old demonstrative forms dër, diu, daz and have also been used as relative pronouns.
There are even more cases (no pun intended) of articles that cline to der:
Singular | männlich weiblich sächlich | Plural | m/w/s
-----------------------------------------------------------
Nominativ | der die das | Nominativ | die
Genitiv | des der des | Genitiv | der
Dativ | dem der dem | Dativ | den
Akkusativ | den die das | Akkusativ | die