How you approach this situation depends a lot on your children's ages. It is much easier to start at an early age. Young boys emulate their fathers. Set the example by going shirtless in appropriate situations, such as doing yard work or hanging around the house. When they are young enough for you to dress them, let them go out in the yard to play without a shirt. Wrestle around in the floor with them shirtless.
If you aren't quite comfortable with yourself shirtless, consider working out and improving your own fitness, but don't forget that you don't have to be perfect. See my previous post, Getting Started. Being fitter may also make your children more likely to emulate you as they get older, rather than dismissing your shirtless habit as some kind of old man thing they are embarrassed of. Again, you don't need to have the chiseled physique of a Greek god, but we should all take care of our bodies.
Consider getting your boys involved in activities where it is commonly accepted for them to go shirtless. Especially for older boys, it can really help for them to see the example among their peers as well. Consider activities like bouldering, or any sport or recreation area where other boys their age commonly go shirtless.
Perhaps you yourself previously taught your sons to be somewhat shy and apprehensive about taking off their shirts and have had a change of attitude. Change is difficult and can leave you wondering where to start. As adults we feel like we are always supposed to be right and never change our minds, but it is important that we show our children that we are rational people who change our minds on the basis of evidence and reason. If you have laid out rules, explicitly or implicitly, don't be afraid to tell them directly the rules have changed. "Remember when we said that you should keep your shirt on when you mow the grass? We've decided that it is completely healthy for you to take your shirt off when you are doing yard work if you want to." Sometimes just the suggestion that it is acceptable in a particular circumstance is all it takes to set them at ease. "It's pretty common for guys to take off their shirts when they go climbing in the area we are going to, so you should feel comfortable taking yours off if you want to."
But finally, don't push it too hard or you'll make it seem weird. The whole point is that it should be natural, comfortable. Don't make them go shirtless, leading by example and on occasion a gentle suggestion should suffice. If your kids have already gotten to be really shy, it make take some time for them to loosen up. Don't worry too much. Try get them in situations where it comes naturally and don't push them too much.
If your child seems to have issues with body image and self-esteem, you might want to address that. If he isn't comfortable with his physique, offer him some guidance on how to work towards what he wants. Again, you can find some helpful advice in the post, Getting Started. Let him know that he doesn't have to meet someone else's ideal to feel comfortable with himself, but that if he wants a better physique, and more importantly a higher level of health and fitness, he can achieve his goals through consistent hard work and healthy lifestyles. If you feel like you aren't able to give the help and guidance he needs, consider getting him on a sports team with a coach who can help or even working with a personal trainer.
Ultimately, the important thing is to give your kids a balanced sense of self-worth, confidence, and the responsibility to care for themselves and their bodies. Try to make them comfortable with themselves, but don't worry too much about whether they adopt the same habits you do.