Understanding Program Size - ATMega328P
The kind-of short answer is the compiler is saving you space by noticing that the while loop is never returning.  Knowing that the function never returns means that it can skip sending the return value up the stack, which saves you two instructions, which is four bytes on AVR.

The longer answer and more useful information:

Assembly is essentially always compiled down to the same size for each instruction (on architectures with only one size of instruction, of which AVR is almost - most  operations are 2 bytes).   That means that more assembly code means a larger program.

You can see the reason that the one with the while() loop is larger if you examine the difference in the assembly listing files.

Listing for the main.c with the while loop: 

  ......
  14                    .file 1 "main.c"
   1:main.c        **** #include &lt;avr/io.h&gt;
   2:main.c        **** #include &lt;stdint.h&gt;
   3:main.c        **** 
   4:main.c        **** int main(void)
   5:main.c        **** {  
  15                    .loc 1 5 0
  16                /* prologue: function */
  17                /* frame size = 0 */
  18                /* stack size = 0 */
  19                .L__stack_usage = 0
  20                .L2:
  21 0000 00C0              rjmp .L2
  22                .LFE0:
  50                .Letext0:
  ..... (Symbol table follows)


And the main.c code without the while loop:

  ...... (everything the same up to here)
  14                    .file 1 "main.c"
   1:main.c        **** #include &lt;avr/io.h&gt;
   2:main.c        **** #include &lt;stdint.h&gt;
   3:main.c        **** 
   4:main.c        **** int main(void)
   5:main.c        **** {  
  15                    .loc 1 5 0
  16                /* prologue: function */
  17                /* frame size = 0 */
  18                /* stack size = 0 */
  19                .L__stack_usage = 0
   6:main.c        ****     return 0;
   7:main.c        **** }
  20                    .loc 1 7 0
  21 0000 80E0              ldi r24,0
  22 0002 90E0              ldi r25,0
  23 0004 0895              ret
  24                .LFE0:
  52                .Letext0:
  ..... (Symbol table follows)


You can see in the lines marked 20-24 in the non-while loop code, that it is loading up a couple registers and then calling the ret subroutine return instruction.  In the while loop one, they skip that, because the compiler realizes that in lines 20-21, nothing is going to get out of that loop.