First to explain you, why you get 512-bit outputs from a 256-bit curve:
The output is basically a point (x-coordinate is enough) and a message-dependant value, with the x-coordinate being expressed as integer. You can verify the signature by checking for a specific relationship between the point and the message-dependant value and the public key point. In order for this relationship to be build the private key is required.
Second, to answer your question why SHA-256 is used and not SHA-512. Consider how the hash function is actually used in ECDSA. You always take the $n$ leftmost bits of it, with $n$ being the curve order bitlength. So if you use SHA-512 you're "wasting" 256 bits, whereas with SHA-256 you "waste" nothing.
And from a key-length point it also makes sense to settle on the 128-bit security level (which is defined through your choice of secp256) and it would make no sense to choose a hash-function with 256-bit security level to be used with a curve providing 128-bits.