Why does maintaining contraction of muscles require ATP?
Actually, it is not. ATP releases the myosin bonded to the actin, so when it is absent, the muscle remains contracted. This is, actually, precisely what happens during rigor mortis after death.

However, as long as you are alive, on a molecular level this is a dynamic process - actin release and bonding - and maintaining it requires energy. Moreover, muscle relaxation is not achieved by stopping the ATP flow, but incurrs additional ATP cost - it happens by actively removing calcium ions required to enable the actin to bind the myosin.