Well you should not see the checkout form when you click on the PayPal button. If you can please post back with a copy of your cart page so we can take a look at this. As for going directly to the failure page when you click on the PayPal button on the checkout page there must be some error occurring with the api call that is being made. On your failure page you should add in this code:
<?php
if(!session_id()) session_start();
echo("Direct Pay Full Request :<br />");
echo("<code>".isset($_SESSION["PP_DirectPayment_postedValues"])?$_SESSION["PP_DirectPayment_postedValues"]:""."</code><br /><br />");
echo("Direct Pay Full Response :<br />");
echo("<code>".isset($_SESSION["PP_DirectPayment"])?$_SESSION["PP_DirectPayment"]:""."</code><br /><br />");
echo("PayPal Express Checkout requests and responses :<br />");
echo("Auth request: ".isset($_SESSION['ECO_Auth_Request'])?$_SESSION['ECO_Auth_Request']:""."<br /><br />");
echo("Auth Result: ".isset($_SESSION['"ECO_Auth_Result'])?$_SESSION['ECO_Auth_Result']:""."<br /><br />");
echo("Get Request: ".isset($_SESSION['ECO_Get_Request'])?$_SESSION['ECO_Get_Request']:""."<br /><br />");
echo("Get Result: ".isset($_SESSION['ECO_Get_Result'])?$_SESSION['"ECO_Get_Result']:""."<br /><br />");
echo("Preocess request: ".isset($_SESSION['"ECO_Process_Request'])?$_SESSION['ECO_Process_Request']:""."<br /><br />");
echo("Process Result: ".isset($_SESSION['ECO_Process_Result'])?$_SESSION['ECO_Process_Result']:""."<br /><br />");
?>
This will let you know what values are being sent and returned from PayPal through the API call. Please post back with this info, also I removed your db posting for security reasons.