Infinitive problem

Solution 1:

'To spend' is a transitive verb here and it needs no preposition (to spend time, money. etc.).

'To write' needs the preposition 'with' to show the instrument (to write with pen, pencil, chalk, etc.) used.