what is the meaning of "it was to be"?
However, 'it was to be' and 'it was' may at times convey the same idea but they cannot be the same everywhere.
Comparing both the examples, I feel a very little difference in them, however, they don't really seem to change the meaning of the sentence.
If I say, 'It was to be the first of many sleepless nights.' I possibly mean to be more concerned about stating that it was the beginning of the sleepless nights and it was the night that turned out to be the first one among all the sleepless nights. Using this phrase, I mean to be a little more expressive about letting my listeners/readers know of where the problem (about experiencing the sleepless nights) started from.
While, if I say, 'It was the first of many sleepless nights.' I possibly don't mean to be concerned about expressing it was the beginning of experiencing the sleepless nights.
CONTEXT MATTERS
What your friend said, may at times be true, depending on the context. There may be situations that cannot take both, 'it was to be' and 'it was' to mean the same thing.
e.g. 'The assignment was to be submitted by 10 o'clock but I couldn't even complete it by then.'
In such a situation, 'was to be' implies that something was supposed to happen but didn't actually happen.
'It was to be the first of many sleepless nights.' The words in bold letters clear the context of this sentence and suggest that it actually was the first sleepless night as the person saying this sentence states they had many sleepless nights later on and therefore, what your friend says about this particular example is incorrect.