There are two main theories for this. The simplest one is the round shape of the knee, possibly influenced by the name of the knee bone, the rótula. Dicciomed, among others, claims this to be the reason:
Lat. alto mediev. rotella(m) es 'ruedecilla' pero también 'rótula'; en castellano por metonimia de la parte por el todo pasó a significar 'rodilla' y está documentado rodiella en 1236; rodilla desplazó a hinojo de lat. geniculu(m), diminutivo de genu, el término lat. de 'rodilla'.
But looking in the Nuevo tesoro lexicográfico de la lengua española (NTLLE), we find another theory in 1611, by Francisco del Rosal in his "Origen y etymología de todos los vocablos originales de la Lengua Castellana":
Rodilla, ò por la forma redonda, ò porque trahían antiguamente en las capas ò manteos una Ruedilla, que oy dicen Rosca, para arrodillarse en las Iglesias; [...]; y otros la trahían pegada a la misma rodilla, de donde se le pegó el nombre.
(Note that this is old Spanish and has somewhat different spelling). According to this theory, the name rodilla comes from a donut-shaped device that was used in old times to put under the knees when kneeling in churches. This device was round and called ruedilla, and may have given its name to rodilla. This theory does not seem to appear in any more recent dictionaries, so the general consensus seems to be the other one. It is, in any case, interesting.