The Wedding was staged.
Bob and the family used Leo's over protectiveness of his sister to snap him out of his Catatonia.
Bob isn't as stupid as he seems.
Bob's insanity is an act; he's simply doing this to fuck with Dr. Marvin while at the same time bringing happiness to the people around him. I elect this as a theory since I think it makes the movie even funnier.