Ramayana was interpolated many times by many people. This part was inserted by the Brahmins since they cannot accept such an act of a lower caste man studying vedas. The original Ramayana was more open & more equal to all castes.
It's interesting that Valmiki himself was from a low caste