Recently, virtualization in wireless sensor networks (WSNs) has witnessed significant attention due to the growing service domain for IoT. Related literature on virtualization in WSNs explored resource optimization without considering communication failure in WSNs environments. The failure of a communication link in WSNs impacts many virtual networks running IoT services. In this context, this paper proposes a framework for optimizing fault tolerance in virtualization in WSNs, focusing on heterogeneous networks for service-oriented IoT applications. An optimization problem is formulated considering fault tolerance and communication delay as two conflicting objectives. An adapted non-dominated sorting based genetic algorithm (A-NSGA) is developed to solve the optimization problem. The major components of A-NSGA include chromosome representation, fault tolerance and delay computation, crossover and mutation, and non-dominance based sorting. Analytical and simulation based comparative performance evaluation has been carried out. From the analysis of results, it is evident that the framework effectively optimizes fault tolerance for virtualization in WSNs.