You can change the number of days MobileMe keeps messages in your junk/trash folders through Mail's preference settings. Deselect the autodelete option if it's deleting them before you have a chance to review them.
If it's actual space that's causing the deletion, then you can change the allocation of iDisk/Mail space available by visiting MobileMe, logging in, and then clicking on the account tab.