A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
If you pass a single literal data value as an argument to SUM it will try to coerce it to a number. So, just as in your example, if you used =SUM(TRUE,TRUE) it would return 2 because each TRUE is a single literal that can be coerced to a number (1). Similarly, =SUM("1","2") will return 3.
If, however, you pass cell references containing those values, or pass them as one array like this:
=SUM({TRUE,TRUE})
or
=SUM({"1","2"})
then no coercion will occur.
If you are asking why that is the case, then you'd probably need to talk to one of the Excel programmers.