You cannot, in an UNION statement, give two different names to a column (here I'm talking about the [$ Debit]/[$ Credit] columns). Moreover, you only have to specify column names in the first query (all subsequent queries will inherit the naming schema).
You have to select 4 columns ; in the first query give the [$ Credit] a null value ; in the second one, give the [$ Debit] a null value.
Thus:
SELECT
COA.acc_code AS [Account Code]
,COA.acc_name AS [Account Name]
,CAST(SUM(debit-credit) AS varchar) AS [$ Debit]
,NULL AS [$ Credit]
FROM
COA JOIN AccountReceivable ON COA.acc_name = AccountReceivable.acc_name
WHERE
COA.acc_name IN ('Account Receivable')
GROUP BY
COA.acc_code, COA.acc_name
UNION ALL
SELECT
COA.acc_code
,COA.acc_name
,NULL
,CAST(SUM(debit-credit) AS varchar)
FROM
COA JOIN AccountPayable ON COA.acc_name = AccountPayable.acc_name
WHERE
COA.acc_name IN ('Account Payable')
GROUP BY
COA.acc_code, COA.acc_name
Hope this helps.