«I studied programing because I thought it would be necessary for my future.» — OK.
I am not sure about your second sentence, "this is because" doesn't sound well to me in this context. I'd just join the last two sentences: «I dedicated myself to learning it because I thought it would be necessary for my future».