I'm asking for reason why you can split Tension(first case) but not mg(second case)
When you say 'splitting,' you really mean projecting a force along some axis.
First let's cover why you 'split' the tension as you did in your first approach.
You know that the net force in the y-direction is zero; finding the y-component of tension helps you solve the problem. That's why you bother to 'split.'
Q. Why can't I split the force of gravity?
A. Of course you can! The question, is, however, along what axes?
From what I understood, you decided to calculate the component of gravity force that lies on the same axis as the tension force (or the string). There is nothing wrong with that. However, the true equation you'd get would be:
$$0 = T - mg\cos\theta + F_{\rm fictitious}$$
The reference frame you chose is non inertial. Though there is no motion along the string, the string itself is accelerating. Thus, there will be what we can call a fictitious force.
The whole reason why we 'split' along x- and y-axis in this problem is because the frame is inertial, so we can solve for the tension.