Example sketch writing to sd twice.

it will run as soon as you download the code, before you even turn on the serial monitor.

When you open the serial monitor is causes the program to reset and run a second time. One way to see this is download the example program, pull the card, and read it in your computer before opening the serial monitor.