I really like the first choice "It was hard not to adopt a defeatist attitude" because it sounds and reads better to me.
I'm not sure of what's "proper," and I believe both examples are correct. (?)
The reason I prefer it:
"adopt" is a verb, so those two words in that exact order "to adopt" fit together so well!
I remember learning Conjugating Verbs, where we stated those two words first:
"to adopt"
Then we went through:
"I adopt; he adopts; they adopt; we adopted; she will be adopting" etc.