Why do Devas stop people from attaining Brahma Vidya?
When a person gets Brahma-Vidya / Moksha then there is no rebirth for that person. And when he doesn't have birth he can't do various sacrifices and rituals for Devatas. So, Gods do not want that men should attain Brahma Vidya. It is explained in Brihadaranyaka Upanishad as:
I-iv-9: They say: Men think, ‘Through the knowledge of Brahman we shall become all’. Well, what did that Brahman know by which It became all ?
I-iv-10: This (self) was indeed Brahman in the beginning. It knew only Itself as, ‘I am Brahman’. Therefore It became all. And whoever among the gods knew It also became That; and the same with sages and men. The sage Vamadeva, while realising this (self) as That, knew, ‘I was Manu, and the sun’. And to this day whoever in like manner knows It as, ‘I am Brahman’, becomes all this (universe). Even the gods cannot prevail against him, for he becomes their self. While he who worships another god thinking, ‘He is one, and I am another’, does not know. He is like an animal to the gods. As many animals serve a man, so does each man serve the gods. Even if one animal is taken away, it causes anguish, what should one say of many animals ? Therefore it is not liked by them that men should know this.
In the Smriti texts also it is explained nicely. For eg. In Shiva Gita from Padma Purana:
रामाय दण्डकारण्ये पार्वतीपतिना पुरा .
या प्रोक्ता शिवगीताख्या गुह्याद्गुह्यतमा हि सा 
यस्याः श्रवणमात्रेण नृणां मुक्तिर्ध्रुवं भवेत .
पुरा सनत्कुमाराय स्कन्देनाभिहिता हि सा 
In olden days in ‘Dandaka’ forest whatever was preached by Lord Shankara to Rama, which is a divine secret, which when implemented in life would give Salvation to human beings, that ‘Shiva Geeta’ was preached to Sanatkumara by Shanmukha (Skanda).
सनत्कुमारः प्रोवाच व्यासाय मुनिसत्तमाः .
मह्यं कृपातिरेकेण प्रददौ बादरायणः 
Subsequently, that Sanat Kumara preached the same to Vyasa। That sage Vyasa became graceful on me and transferred that knowledge to me.
उक्तं च तेन कस्मैचिन्न दातव्यमिदं त्वया .
सूतपुत्रान्यथा देवाः क्षुभ्यन्ति च शपन्ति च 
Suta further cautioned his disciples not to discourse this knowledge to anyone, else Devatas of heaven would become displeased and would curse!
अथ पृष्टो मया विप्रा भगवान्बादरायणः
भगवन्देवताः सर्वाः किं क्षुभ्यन्ति शपन्ति च 
तासामत्रास्ति का हानिर्यया कुप्यन्ति देवताः
पाराशर्योऽथ मामाह यत्पृष्टं शृणु वत्स तत 
Hearing this i said, “Hey Muni! how are you speaking like this? What harm would Gods face if someone tells this Shiva Geeta to others? Why would they become angry? Why would they curse?” When i questioned him, VedaVyasa showered his affection on me and explained me like this.
नित्याग्निहोत्रिणो विप्राः संति ये गृहमेधिनः .
त एव सर्वफलदाः सुराणां कामधेनवः 
भक्ष्यं भोज्यं च पेयं च यद्यदिष्टं सुपर्वणाम
अग्नौ हुतेन हविषा सत्सर्वं लभ्यते दिवि 
नान्यदस्ति सुरेशानामिष्टसिद्धिप्रदं दिवि
दोग्ध्री धेनुर्यथा नीता दुःखदा गृहमेधिनाम 
तथैव ज्ञआनवान्विप्रो देवानां दुःखदो भवेत
त्रिदशास्तेन विघ्नन्ति प्रविष्टा विषयं नृणाम 
In this world, the Brahmin who is a householder (gruhastha), doing Homams and Yagyams by dedicating food and beverages to Gods through fire; such Brahmins are like Kamadhenu to the Demi-Gods because from their Yagyas and Havans the Gods get their food. The Gods accept these offerings with pleasant heart and happiness. (In turn Gods maintain timely rains and help the earth produce grains properly). So, it’s a duty of Brahmins to regularly do the homams and yagyams and keep the Gods happy (to get food on earth in return). If Brahmins leave doing these fundamental duties to Gods and immerse themselves in Yoga and in learning about the absolute Brahman (Supreme Lord) and attain pleasure in serving him through the path of knowledge/bhakti, it makes Gods unhappy since they wouldn’t get their share of food through sacrifices.For that reason they may become unhappy and may curse. If someone else steals the milk giving cow and takes in a different direction the way its actual owner would feel uncomfortable and would want to get it back, same way these demi-gods also feel uncomfortable when some Brahmin deviates away from his path of normal duties towards the path of Salvation, and in order to get him back for their happiness they try to create disturbances in all possible ways on the devotee’s path towards salvation.
ततो न जायते भक्तिः शिवे कस्यापि देहिनः .
तस्मादविदुषां नैव जायते शूलपाणिनः 
यथाकथंचिज्जातापि मध्ये विच्छिद्यते नृणाम
जातं वापि शिवज्ञआनं न विश्वासं भजत्यलम 
That’s why Devotion for Parama Shiva doesn’t take birth in anyone, due to the Gods devotion for Shiva doesn’t remain constant. In case with a lot of efforts if someone manages to gain devotion for Lord Shiva, due to the disruption from the demi gods, the devotion gets inturrupted. But when that doesn’t happen, Love for Lord Shiva emerges out of the devotion.
I got translation of Shiva Gita from here.
Note: “The question: Why do Devas stop people from attaining Brahma Vidya?” is licensed by Stack Exchange Inc (https://hinduism.stackexchange.com/); user contributions licensed under CC BY-SA.