P&L account is an nominal account. Rule for this type of account is Debit all exp & loss and credit all gains & income. So if the credit side is larger than the debit side then naturally its a profit so it is written on the debit side profit c/f to tally the P&L account.
for e.g. if credit side of P&L is say 100000 and debit side is say 75000, so on the debit side it would be written as profit c/d 25000. If it is written on the credit side then the P&L wont tally. Credit side would be 125000 and debit side would be only 75000 whihc would mismatch the totals.
On the other hand if it is a loss then debit side is greater than credit side and it will be written on the credit side as loss c/f same as explained above..
hope this would resolve your doubt