In your 2nd test:
TPMCH1/PTB5 is programmed to be a PWM output.
The waveform will be (approx) 66% duty cycle - high true.
Since it is programmed as a PWM, the bits written to port B will not affect the PTB5 output.
TPMCH0/PTA0 is programmed as an output (no PWM).
The PTA0 output will go low (0) and will remain low because you have written 0's to the port.
Are you testing this with the debugger on the DEMO9S08QG8 board?
I have loaded both of your programs onto the demo board, 'scoped the output pins, and they work as programmed in each case.
What are you trying to accomplish with the outputs?
Frank