The reason why it is Mario's favorite food and why he eats it all the time and is addicted to it is because, as shown in "The (TOTALLY ACCURATE) Documentary of Mario", Mario saw a girl while he was in high school, and seemingly fell in love with her however she walked away and left her spaghetti plate on a table. Mario immediately falls in love with the spaghetti and since them he has been addicted to it and eats it all the time, being his favorite food. It had gone to the point where he and the spaghetti wed in Doki Doki Mario Club.
Spaghetti appears as an item in the Paper Mario series.
Sometimes spaghetti seems to be sentient, as in some bloopers, when Mario eats it, screams can be heard, and blood is visible, and in Cooking with Bowser and Mario 2, the spaghetti was upset when Mario was eating ravioli, and it yelled "I THOUGHT WHAT WE HAD WAS SPECIALLLLLLL" and shoots Mario with a machine gun for "cheating on it".
SMG4 hates spaghetti (and Italian food also) in real life. However, it's shown in the video "War of the Fat Italians 2014 (200k special!)" that he's able to eat some when there's nothing else to eat. And in the first episode of Hitbox, SMG4 ate it because he played Mario.
In Theawesmario eats spaghetti (one of the videos on Mario's YouTube channel), Mario eats spaghetti for 3 hours. (The whole video is actually 14 minutes and 45 seconds long.)