Its an accounting problem:
$30 = $1 in the pocket of person A +
$1 in the pocket of person B +
$1 in the pocket of person C +
$2 as a tip for waitress+
$25 inside burger place cash register
The original sum of the money in the problem is not a sum of money that the three people paid originally, as that would need to include the money the burger place has in this case $25.
$27 already includes the waitress's tip. To add the $2 to the $27 would be to double-count it.