In traditional Asian Martial Arts, you find predominantly three schools of thought that were the primary influences upon its inception: Confucianism, Taoism, and Buddhism.
There is great care taken in using the term "schools of thought" because it is important to understand Martial Arts has no direct religious ties. Martial Arts, in and of itself, is secular. And if you review the three schools of thought mentioned, you will find they too started in very secular beginnings.
Confucianism began as a series of scripts as to how one should conduct themselves. A "book of etiquette" for a lack of better terms. The writings speak about respecting your elders, holding true to your family and those that raised/trained you, and being honorable in all that you do. All of these characteristics are demonstrated not only in Martial Arts but also in most Asian cultures that have adopted this way of thinking.
At its start, Confucianism was not a religion. There were no deities or gods. A lot of the religious aspects came into play as the religion as governments tried to use this fidelity that is born out of these scriptures to their advantage.
Taoism has a very similar beginning. True Taoism is not a religion but rather a ways of life. It speaks to harmony with nature and finding balance in everything. This is where the concepts of the yin and the yang come from.
In Taoism as its purest form, one cannot ever point to the Tao for once one tries; they are at the furthest point from. In other words, how do you define something that is part of everything and not an entity of its own? The popularity of Taoism, especially with its focus around nature, made it easily a popular religion among the masses in an agricultural Asia. Again, in an attempt to capitalize this popularity, governments and local authorities introduced deities and other rituals that made it into a religion.
Finally Buddhism is born from the concept of finding enlightenment. Unlike the above two, Buddhism’s legends begin with Buddha, Siddhartha, seeing four realities in life: birth, old age, sickness, and death. This realization made him leave his worldly goods and take up his journey as a holy man to seek out answers to the problems of life. His journey took many routes and various twists and turns. It was not until he came to peace with himself through meditation that he reached enlightenment. It is this inner peace, the ability to meditate and become one with your surroundings that Martial Arts has absorbed and can be found in almost every aspect of the Arts.
Buddhism, especially in China, played a critical role in the development and preservation of Martial Arts -- but not for religious reasons. Throughout history, religions always came under scrutiny in China. Religion was a power, a means to sway the masses to your side. And should the authority/government fall out of favor with any religious movement, they risk being meet with uprisings and conflict. Thus, the powers of most religions in China were constantly challenged in an attempt to control and subdue the effects they might have on the governing bodies.
Buddhism, much like Taoism, found strong links with the agricultural world of ancient China, which called for harmony with nature. Thus, their influence was potentially large and this posed a threat to most governments. Being persecuted, Martial Arts became a logical way to not only keep their bodies in shape but also defend themselves.
In addition, many of the temples were in secluded, hard to reach locations. Most governments would not dare a direct or outwardly attack on these locations for fear of inciting more turmoil and up rise. So these places also became havens for those running from persecution for political reason. Thus, this became a place to spread Martial Arts to others as these people moved from place to place.
The history of Martial Arts is long and has many twists, turns, and legends. But it should be clear that while there are schools of thought that have influenced Martial Arts, the practice of Martial Arts does not mean one is practicing of any of those religions.