Recently Indian ruling government declared a state Jammu and Kashmir as Union territory by splitting the state into two parts
No, Indian government didn't do such thing as of Aug 5, 2019. The Home Minister of Union Executive so far tabled a Bill in the Rajya Sabha which would bifurcate the state of J&k into two Union territories, as mentioned in the Bill. The Bill has been passed in that House and is yet to be passed(as of Aug 5, 2019) by the Lok Sabha. It then needs to be assented by the President to turn it into an Act of Parliament. Afterwards, it then has to be published for general public information in the Gazette of India mentioning the date with which the Act would take effect.
Why was this done, [and] what are reasons for doing this[?]
Statement of Objects and Reasons for the Bill mentions:
The Ladakh Division of the State of Jammu and Kashmir has a large area but is sparsely populated with a very difficult terrain. There has been a long pending demand of people of Ladakh, to give it the status of a Union Territory to enable them to realise their aspirations. The Union Territory of Ladakh will be without Legislature.
Further, keeping in view the prevailing internal security situation, fuelled by cross border terrorism in the existing State of Jammu and Kashmir, a separate Union Territory for Jammu and Kashmir is being created. The Union Territory of Jammu and Kashmir will be with legislature.
For J&k, here is the plan from the Home Minister Amit Shah:
Full state status will be restored to Jammu and Kashmir at appropriate time, when normalcy returns.
The Leh and Kargil districts are being clubbed together as UT of Ladakh. Given their wiki pages, the combined area would be around 59,196 sq. Km covering a mere population of ~2.75 lakhs (0.275 million), which does not seem to be in need of a statehood. Besides, the region borders China which has boundary disputes with India, so a UT is justified from all fronts.
To put it simply, UT of Ladakh is from strategic point of view, while UT of J&k is from security point of view, given the region's links with terrorism.