You have a high output for 500uS, then a low for 500uS, then low for ~110uS while the analogRead of the low output happens, then low some more while the float math happens, then low some more while Serial.print runs, and finally low some more while loop completes and jumps back for the digitalWrite to finally go high again.
analogRead returns a reading of the decaying capacitor multiplied by 4.88mV, so you might get something other than 0.
Lose the Serial print and it'll be more reasonable, but basically this isn't
a great way to generate PWM as you are using delay / delayMicroseconds.
You can improve matters by going over to the blinkWithoutDelay style of
coding (using micros() rather than millis()), but things like Serial will
cause issues as they wait...
This is why hardware PWM is provided in the first place, since the software
solutions are awkward and tricky.
Using timer interrupts allows the best software solution, and you might want
to see how the Servo library uses this approach.