The second one is more correct because it employs parallel construction. From the Purdue Online Writing Lab, https://owl.english.purdue.edu/owl/resource/623/01/.
Parallel structure means using the same pattern of words to show that
two or more ideas have the same level of importance. This can happen
at the word, phrase, or clause level. The usual way to join parallel
structures is with the use of coordinating conjunctions such as "and"
Words and Phrases
With the -ing form (gerund) of words:
Parallel: Mary likes hiking, swimming, and bicycling.
With infinitive phrases:
Parallel: Mary likes to hike, to swim, and to ride a bicycle. OR Mary
likes to hike, swim, and ride a bicycle.
Despite using a gerund in the subject of the sentence (My goal of attending college), you should use the to-infinitive in the predicate. This is because when speaking of what the desired outcome will be (to educate myself), we more naturally speak of goals being to do something, rather than doing something. On the other hand, when you speak of what you will do to accomplish the goal (attending college), it is more natural to use a gerund construction. Construction of subject and predicate does not have to be parallel.
I might even recast it slightly: The goal of my attending college is to educate myself, not to obtain a degree. This is because attending college is not the goal, it's the means of attaining it.
In any case, you need to lose the first comma (after college).