The first one is of the following form:
[subject] + be + [adjective] + to-infinitive
This is usually to express our feelings about a particular action. For example,
It must be exciting to travel the world.
This first 'to' is the first part of the to-infinitive.
The second is also a to-infinitive with a similar structure but re-written to exaggerate the meaning. We can re-write (2) this way:
I was a fool to fall for a man like you.
'a fool' is a noun, but it has a adjective meaning. We can also say:
I was foolish to fall for a man like you.
Here is another example of using a noun with a 'to-infinitive':
It was a pleasure to meet you.
'a pleasure' is a noun, but we use it with a adjectival or adjective-like feeling.
Student or Learner