The direction of frictional force in smooth rolling motion
For First Case: the rotation produced by the torque at the centre of wheel will rotate the wheel in the clockwise direction, but here friction is present, as friction opposes the motion of particle that's why it acts in anticlockwise direction and helps the body to move.
For Second Case: here $mg\sin\theta$ will act along the line of centre of mass, which would simply make the sphere to slide down (because $mg$ itself is denoted as weight of the body, and this weight acts in the downward direction from the centre of mass of the body, so its component i.e, $mg\sin\theta$ will not be able to provide the torque on the sphere, because it will also act along the line of C.O.M), as we already know that friction opposes the motion of object it acts in opposite direction of motion of the sphere and provides the necessary torque, thus helping in the rolling of sphere down the ramp.
So, in the first case the frictional force have the same direction with the acceleration of the center of mass but it's not in the latter one. Can someone explain the difference between those 2.
In your first case, you say "to make the wheel roll faster", but you don't say how this is done. Is is pushed? Do you apply a torque to the axle?
If you are assuming that a torque is applied to the axle, then that is the difference between the two.
In the first case you are taking a torque and using it to generate linear motion. In the second case you are taking a linear force and using it to generate rotational motion.
Can you explain the difference between being pushed and having a torque applying to?
Imagine a wind-up toy. If you wind it up and release it, it places a torque on the wheel. Think of using this on a frictionless floor. If you wind it up, the wheel spins and it doesn't move. If you push it, the car moves, but the wheel doesn't spin.
When we instead have a normal floor and the wheel rolls, then friction slows down the first wheel and speeds up the second wheel. Therefore the frictional force must act in opposite directions.