这两个句子都是动词不定式作后置定语.
a pen在句中作宾语,the best season在句中作表语.
I have a pen to write with.
这句话中,pen 不是动词write的逻辑宾语,with在此是介词,意思是:用(...工具).
Spring is the best season to plant trees.
这句话中不定式to plant trees作后置定语,修饰the best season.
意思是:植树的最好季节.
Spring 在这个句子中是作主语的,当然不要介词in.否则不是变成时间状语了吗,那样就不是作主语了.
个人意见,仅供参考!