Inside the transistor there is a capacitor from B to E and from B to C. The 10K resistor and the base capacitance forms a low pass filter. This removes the sharp edges in a square wave leaving the sine wave. Try reducing the base resistor from 10k to 1k.
I think Ron read your post backwards. Sine in --> square out is caused by the transistor amplifier gain being too high. If you increase the input resistor (e.g. 220k) you will probably see half of the sine wave at the output, depending on the input amplitude. If you want to see the whole sine wave then you'll have to bias the transistor so that it's always conducting.
It will be easier if you AC-couple (ie with a capacitor) the input signal too.
If you want a sine wave out you need a linear amplifier. This one is just a switch.
If you Google transistor biasing you will find some tutorials and/or calculators.
If you are trying to amplify a sine wave then you are using probably one of the worst circuits ever.
No negative feedback.
No temperature stability.
You are better off using a power op-amp. Google it.
I have batch controller with a passive transistor output. This controller receives setpoint input from operator, when that setpoint is reach it will trigger the 24VDC solenoid valve.
Before the setpoint is reach, it gives 2VDC output and when it reaches the setpoint the voltage turns 0VDC.
I need somekind of converter to change this 2V transistor output to become 24V. Any advice will be much appreciated