Bhagwad Gita, Chapter 3 talks a lot about Karma. While the whole chapter is essential to understand Karma Yoga, I am reproducing few shlokas here, relevant to the question.
Is Karma optional? No, it's inherent property
Karma is not avoidable. We continue to do karma without stopping even for a second. One can't run away from it. This is because all entities are created out of Brahman and Karma leads them back to Brahman. There is no other way to go back to Brahman except Karma.
सहयज्ञा: प्रजा: सृष्ट्वा पुरोवाच प्रजापति: |
अनेन प्रसविष्यध्वमेष वोऽस्त्विष्टकामधुक् || 10||
In the beginning of creation, Brahma created humankind along with duties, and said, “Prosper in the performance of these yajñas (sacrifices), for they shall bestow upon you all you wish to achieve. (Commentary)
सदृशं चेष्टते स्वस्या: प्रकृतेर्ज्ञानवानपि |
प्रकृतिं यान्ति भूतानि निग्रह: किं करिष्यति || 33||
Even wise people act according to their natures, for all living beings are propelled by their natural tendencies. What will one gain by repression? (Commentary)
न हि कश्चित्क्षणमपि जातु तिष्ठत्यकर्मकृत् |
कार्यते ह्यवश: कर्म सर्व: प्रकृतिजैर्गुणै: || 5||
There is no one who can remain without action even for a moment. Indeed, all beings are compelled to act by their qualities born of material nature (the three guṇas). (Commentary)
न कर्मणामनारम्भान्नैष्कर्म्यं पुरुषोऽश्नुते |
न च संन्यसनादेव सिद्धिं समधिगच्छति || 4||
One cannot achieve freedom from karmic reactions by merely abstaining from work, nor can one attain perfection of knowledge by mere physical renunciation. (Commentary)
Certain karmas are Superior
What one can do is to own it's karmas, control it and shape it in proper way. It's like large pool of water : if left just like that it spreads everywhere and takes form of a pond (largely static); Or if shaped and controlled properly takes form of a River which nourishes civilizations while also meeting it's goal, that is, Ocean.
यस्त्विन्द्रियाणि मनसा नियम्यारभतेऽर्जुन |
कर्मेन्द्रियै: कर्मयोगमसक्त: स विशिष्यते || 7||
But those karm yogis who control their knowledge senses with the mind, O Arjun, and engage the working senses in working without attachment, are certainly superior. (Commentary)
यज्ञार्थात्कर्मणोऽन्यत्र लोकोऽयं कर्मबन्धन: |
तदर्थं कर्म कौन्तेय मुक्तसङ्ग: समाचर || 9||
Work must be done as a yajña (sacrifice) to the Supreme Lord; otherwise, work causes bondage in this material world. Therefore, O son of Kunti, perform your prescribed duties, without being attached to the results, for the satisfaction of God. (Commentary)
Why should we perform Superior karmas?
Not doing any karma leads to fall of the entity itself. By doing superior karma, one can reach to Brahman faster. Isn't that what this is all about anyway?
नियतं कुरु कर्म त्वं कर्म ज्यायो ह्यकर्मण: |
शरीरयात्रापि च ते न प्रसिद्ध्येदकर्मण: || 8||
You should thus perform your prescribed Vedic duties, since action is superior to inaction. By ceasing activity, even your bodily maintenance will not be possible. (Commentary)
यस्त्वात्मरतिरेव स्यादात्मतृप्तश्च मानव: |
आत्मन्येव च सन्तुष्टस्तस्य कार्यं न विद्यते || 17||
But those who rejoice in the self, who are illumined and fully satisfied in the self, for them, there is no duty. (Commentary)
तस्मादसक्त: सततं कार्यं कर्म समाचर |
असक्तो ह्याचरन्कर्म परमाप्नोति पूरुष: || 19||
Therefore, giving up attachment, perform actions as a matter of duty, for by working without being attached to the fruits, one attains the Supreme. (Commentary)
Karma is intrinsic even in Brahman
We think karma is just for mortal beings? No. Karma is for everyone, even Brahman. Brahma, Vishnu and Shiva also perform karma and receive their phal (fruits). Otherwise, this whole system would crumble down.
न मे पार्थास्ति कर्तव्यं त्रिषु लोकेषु किञ्चन |
नानवाप्तमवाप्तव्यं वर्त एव च कर्मणि || 22||
There is no duty for me to do in all the three worlds, O Parth, nor do I have anything to gain or attain. Yet, I am engaged in prescribed duties. (Commentary)
उत्सीदेयुरिमे लोका न कुर्यां कर्म चेदहम् |
सङ्करस्य च कर्ता स्यामुपहन्यामिमा: प्रजा: || 24||
If I ceased to perform prescribed actions, all these worlds would perish. I would be responsible for the pandemonium that would prevail, and would thereby destroy the peace of the human race. (Commentary)
Burden of Superior Karma on Gods and Humans
Gods and Humans are superior entities created by Brahman. They must perform superior actions in order to guide the ignorant (lesser mortals like animals, plants and this world). Gods show this to humans, and humans to the rest of world. Many scriptures talk about maintaining trees, animals, wells, ponds etc. in effect to that - see Mahabharat, Shanti Parva. In Uttar Kand, Valmiki Ramayan, Brahma says this to Indra that because you did this sin (Ahalya story), humans will also learn from you and start doing this sin. Hence, it's not just the good deeds but bad deeds also originate from Devas.
यदि ह्यहं न वर्तेयं जातु कर्मण्यतन्द्रित: |
मम वर्त्मानुवर्तन्ते मनुष्या: पार्थ सर्वश: || 23||
For if I did not carefully perform the prescribed duties, O Parth, all men would follow my path in all respects. (Commentary)
न बुद्धिभेदं जनयेदज्ञानां कर्मसङ्गिनाम् |
जोषयेत्सर्वकर्माणि विद्वान्युक्त: समाचरन् || 26||
The wise should not create discord in the intellects of ignorant people, who are attached to fruitive actions, by inducing them to stop work. Rather, by performing their duties in an enlightened manner, they should inspire the ignorant also to do their prescribed duties. (Commentary)