Castro was born on January 21, 1751, in Santafé de Bogotá, the capital of the Viceroyalty of the New Granada.
On June 25, 1812, Castro was left in charge of the Presidency of the State of Cundinamarca by Nariño,[5] who went to Tunja to fight the Royalist forces in the South.
He was officially elected President of the State on August 19,[6] and served until September 12[7] when Nariño returned and assumed power again.
After the Spanish Reconquista of the New Granada, Pablo Morillo expelled Castro from Santafé de Bogotá and sent him to Tunja, leaving all his fortune behind.
Pablo Morillo did not know what to do with him, he was too eccentric, and during his time in power was criticized for being too inept, he posed no danger to the Reconquista, and Morillo finally decided to expel him from Bogotá, and sent him to Tunja, with the excuse of having weapons in his house, the weapon being a ceremonial sword he always carried,[11] After his death, the newspaper La Miscelánea, printed a very critical obituary of him for being single his whole life, because, as he said "...It is too much to risk uniting with a woman, whose character may be assumed, but never understood...".