It does it because it's the right answer. Excel sees dates as numbers. 11th Feb 19 would be 43507 and 9th Feb 19 would be 43505. Subtract the latter from the former and 2 is the answer.

If you have 1's in the column because there are no dates in those rows then maybe =IF(SUM(A4:B4),B4-A4+1,0) will do what you need?
There are many many ways of doing this. This is just the first that springs to mind without Excel open in front of me.

BSB